Closed Bug 481316 Opened 15 years ago Closed 15 years ago

Users can only watch one category in a specified language

Categories

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

x86
All
task
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: ecooper, Assigned: ecooper)

References

()

Details

(Whiteboard: tiki_fixed)

Attachments

(2 files)

Due to how Tikilib::add_user_watch adds watches, users currently can't watch one category in more than one language.

STR:
1. Login and visit "My Watches"
2. Add a watch for the "Additional Categories" category in the Albanian language
3. Add a watch for the "Additional Categories" category in the Assamese language

Expected:
Two watches for the "Additional Categories" category--one for Albanian and one for Assamese.

Actual:
The Assamese watch will replace the Albanian watch
Tikilib::add_user_watch deletes the watch you're adding to prevent duplicates. 

If you constrain that delete by watch 'type' as well, it will fix this bug. Unfortunately, it will also cause duplicate primary keys (which go by event and object, which made sense when watches were just for objects and not objects from a particular language). Fixing this may require expanding the primary key to include `type` or some other schema change to the tiki_user_watches table.
Unless we want (which we may want to in the future) to rework how watches work in tiki, this schema change is needed.
Attachment #367514 - Flags: review?(laura)
Attachment #367514 - Attachment is patch: false
And this is the patch to go with the new SQL.
Attachment #367515 - Flags: review?(laura)
Comment on attachment 367514 [details]
Adding `type` as a primary key for tiki_user_watches

This is ok but it's going to take a while to run in prod - just give IT a heads up when we push.
Attachment #367514 - Flags: review?(laura) → review+
Attachment #367515 - Flags: review?(laura) → review+
I'll file an IT bug in the morning to get the SQL run on prod so we can test the patch.

It's also noteworthy to mention that the SQL *needs* to be run before the patch.
The SQL update was run in bug 483969.

The patch is in r23582/r23583.

Just to reiterate, we'll need the SQL run on prod *before* the 1.0 code is pushed to prod.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Whiteboard: tiki_bug
Whiteboard: tiki_bug → tiki_fixed
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: