Closed Bug 489210 Opened 15 years ago Closed 15 years ago

Automatically create staging copies of directly-approved articles

Categories

(support.mozilla.org :: Knowledge Base Software, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: cilias, Assigned: paulc)

References

Details

(Whiteboard: tiki_bug, tiki_upstreamed)

Attachments

(1 file, 1 obsolete file)

I think we should make sure it's not possible to create articles that start with *
Laura, does that sound like the right approach?

Chris: Do those articles have corresponding non-* articles that are in the proper places?
Assignee: nobody → paul.craciunoiu
We may also consider restricting articles that start with * to the staging area only.
Yes, they have corresponding non-* articles.

Looking at the article history, it appears these are unedited article, since the approved versions were move to the KB. Do you think that when the approved version was moved to the KB, the staging copy was automatically created, but not in any category?


[1]<https://support.mozilla.com/tiki-pagehistory.php?locale=en-US&page=*Firefox+has+just+updated+tab+shows+each+time+you+start+Firefox>
[2]<https://support.mozilla.com/tiki-pagehistory.php?locale=en-US&page=*How+the+phishing+and+malware+protection+in+Firefox+works>
May be related to this, but here's an article that was created today that is not in any category.
<https://support.mozilla.com/en-US/kb/godin+van+de+Liefde>
(In reply to comment #3)
> Yes, they have corresponding non-* articles.
> 
> Looking at the article history, it appears these are unedited article, since
> the approved versions were move to the KB. Do you think that when the approved
> version was moved to the KB, the staging copy was automatically created, but
> not in any category?
I think that's possible. Need to investigate.
Blocks: 487362
(In reply to comment #4)
> May be related to this, but here's an article that was created today that is
> not in any category.
> <https://support.mozilla.com/en-US/kb/godin+van+de+Liefde>
While playing with bug 489874, I noticed this can happen if you create a directly approved page ... or something of the sort. I can't exactly remember the STR, but I reproduced it.

Bug 489874 should take care of half of the trouble. This bug can be made to ensure any article has to be in a category, and if the category is not set, the default is the staging area.

Chris: before or after this is fixed, you may want to file/fix a bug about moving making sure all current articles are in a category.
Summary: Some staging copies are not in the staging area → Articles can be created with no category
Target Milestone: --- → 1.3
Blocks: 467033
This patch ensures staging articles are created for articles that are created straight in the KB category. Currently, if you do that, the KB article does not have a corresponding staging article.

For devs: the code for automatically creating a staging copy is the same, but moved into a function with global variables. The function is now being called in two places: both for a new and existing page.

I'm basically looking at all the times $tikilib->create_page is being called, and ensuring that the staging page is also created then. The one circumstance that's not being done yet is inside the if starting at lines 304 (272 before patch):
---
if (isset($_FILES['userfile1']) && is_uploaded_file($_FILES['userfile1']['tmp_name'])) {
---
But we don't use this feature, right?
Attachment #386104 - Flags: review?(smirkingsisyphus)
Attachment #386104 - Flags: review?(laura)
Depends on: 504265
Summary: Articles can be created with no category → Automatically create staging copies of directly-approved articles
This would be great to get in 1.2.1, articles in no category cause all sorts of problems with the KB.
Target Milestone: 1.3 → 1.2.1
Comment on attachment 386104 [details] [diff] [review]
create staging of pre-approved article

Can we have some params rather than all those globals please?
Attachment #386104 - Flags: review?(laura) → review-
Attachment #386104 - Attachment is obsolete: true
Attachment #386104 - Flags: review?(smirkingsisyphus)
Attached patch patch, v2Splinter Review
This has no globals.
Attachment #389737 - Flags: review?(laura)
Attachment #389737 - Flags: review?(laura) → review+
r30192 / r30193
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Chris, mind checking this out if you have some time?
Vishal and I looked at this, and it seems that staging copies *are* already created for new KB articles that are created directly in that category.

(We were going off comment 7.)

A concise testcase would be most appreciated; thanks!
The problem before this fix was that a staging page was created in one situation (1) but not another (2)
(1) when a current article was being moved from Staging to KB
(2) when an article was created in the KB from the beginning
Whiteboard: tiki_bug
Just for my information before I commit code. This is unlikely to break anything as far as I am concerned.

What does it do? What is a directly-approved article?

Are there any other dependencies to this that might need to be upstreamed?
Whiteboard: tiki_bug → tiki_bug, tiki_discuss
LPH: In the larger scope of things, we would like to have "staging" pages for certain categories. We currently have this for only one category (Knowledge Base), but I would much prefer it if you could help us apply this system to any category (in a set list).

You probably know this next paragraph, but I'll explain it anyway. The staging process works by keeping a copy of the approved page (only visible for logged in users) and editing that one. Then we have approvers (users in a given user group) go through and merge the changes to the approved page. You upstreamed the UI for this here: bug 446082. Finally, since we want all pages in a list of categories (currently only Knowledge Base) to have a staging copy for regular users to edit, this bug was to ensure that a staging copy always exist for a given Knowledge Base page.

As comment 14 states, before this bug, if you created a new page directly in the Knowledge Base category, the staging copy would not be created.

To answer your last question: anything that implements this staging/approval system must be upstreamed for this whole process to work. Most of the functionality lies in tiki-approve_staging_page.php and create_staging() from tiki-editpage.php

I hope I answered your questions. Let me know if you have any other concerns.
Whiteboard: tiki_bug, tiki_discuss → tiki_bug, tiki_upstreamed
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: