bugzilla.mozilla.org has resumed normal operation. Attachments prior to 2014 will be unavailable for a few days. This is tracked in Bug 1475801.
Please report any other irregularities here.

Document._clean_category() without an ID updates all docs without parents :(

VERIFIED FIXED in 2.3.1

Status

support.mozilla.org
Knowledge Base Software
P1
normal
VERIFIED FIXED
8 years ago
8 years ago

People

(Reporter: rbillings, Assigned: jsocol)

Tracking

({dataloss})

unspecified
2.3.1
x86
Mac OS X
dataloss

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

8 years ago
Articles are created with 'troubleshooting', as we migrated articles. For unknown reasons the categories are flipping. At last count all articles had been flipped to the 'Navigation' category.
(Reporter)

Updated

8 years ago
Priority: -- → P1
(Assignee)

Updated

8 years ago
Duplicate of this bug: 615806
(Assignee)

Comment 2

8 years ago
Now everything has moved to Troubleshooting.
(Assignee)

Comment 3

8 years ago
On support-stage, everything is in Troubleshooting. Trying to find a way to switch it all somewhere else.
(Assignee)

Updated

8 years ago
Summary: Production randomly changing KB article categories → Document._clean_category() without an ID updates all docs without parents :(
(Assignee)

Comment 4

8 years ago
master: https://github.com/jsocol/kitsune/commit/0403ec
2.3.x: https://github.com/jsocol/kitsune/commit/d960727
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
(Assignee)

Comment 5

8 years ago
For posterity:

In Document._clean_category() we call something like

  self.translations.all().update(category=self.category)

Unfortunately, when you call that on an unsaved article, the SQL it generates to get translations.all() is something like: "SELECT id, ... WHERE parent_id IS NULL". So it was changing all documents without a parent, which is 1) all of English, and 2) any docs in other languages that aren't translations.

This sucks. It's dataloss, but maybe we can get close to correct with a big-ol-SQL file doing some updates. We still have Paul's migration data, we should be able to do something like pull out ID and Category and run it as an update. Filing a new bug for that.

Any articles created last night after the migration will have to be manually moved back.
Keywords: dataloss
... I feel so... betrayed... Django should warn about this ... at least in their documentation. Maybe they do and we all missed it.
(Reporter)

Comment 7

8 years ago
Verified creating a new document with a non-default category did not switch existing US documents without a parent.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.