Closed Bug 511804 Opened 15 years ago Closed 15 years ago

"Duplicate entry 'user_review_approval" error message trying to move an article from staging -> HTC

Categories

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

x86
All
task
Not set
major

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: stephend, Assigned: paulc)

References

()

Details

(Keywords: regression, Whiteboard: tiki_test)

Attachments

(2 files)

Attached image Screenshot
As an Admin

1. Load https://support-stage.mozilla.org/tiki-editpage.php?locale=en-US&page=oscar+the+grouch2
2. Move it into the "How to Contribute" category

Expected Results:

Article saves into the HTC category (since you're an Admin)

Actual Results:

An error occured in a database query!

Context:
File	tiki-editpage.php
Url	tiki-editpage.php?locale=en-US
Query:
insert into `tiki_user_watches`(`event`,`object`,`email`) values(?,?,?)
Values:
0	user_review_approval
1	5847
2	stephen.donner@gmail.com
Message:
Duplicate entry 'user_review_approval-5847-' for key 1
Built query was probably:
insert into `tiki_user_watches`(`event`,`object`,`email`) values('user_review_approval','5847','stephen.donner@gmail.com')
Ive just checked your article and it appears to be in the HTC category. Maybe im looking wrong (3am here) or maybe it goes through even with the error.
This seems to work fine for me. Maybe it was my screw-up in bug that caused it.

See:
https://support-stage.mozilla.org/en-US/kb/tplug5?bl=n (created in staging, moved to HTC)
and
https://support-stage.mozilla.org/en-US/kb/tplug4?bl=n (created in staging, moved to KB, then moved to HTC)

However, I did encounter a problem when moving an article from the staging area to the HTC category. This might have to do with bug 498056 -- the article is placed both in staging and HTC.

Stephen, keep playing around and give me some STR with an article starting from scratch if you can.

For now, this doesn't seem to be a new problem.
Paulc, can you take another look given the screencast?
I talked to Stephen offline, told him to try with a new article after I saw the screencast. Should've posted here.

Either way, I will look at the code and see what happens on moving HTC article (see comment 2). Might re-summarize this bug once I figure out what happens. At first glance, though, the staging->HTC bug seems related to bug 498056, but the duplicate entry probably happened for other reasons (especially if the page creation timed out).

I couldn't reproduce locally yet.
I can't reproduce this anew, but can, only on the article mentioned above.
Attached patch patch, v1Splinter Review
Thanks Stephen! This bug prompted me to look over my code, and I realized that I missed something.

Patch moves the code for notifying the user when an article has been approved only when the article is actually in the staging area (doh). I'll place that in the bug summary.

This might also fix the duplicate entry issue, but if not, it should at least fix (what I suspect is) the reason it happened.
Attachment #396176 - Flags: review?(laura)
Can we get this reviewed today, Laura?  I'd like to continue testing, thanks!
Attachment #396176 - Flags: review?(laura) → review+
r50313 / r50314
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Whiteboard: tiki_triage
Verified FIXED; thanks, Paul!
Status: RESOLVED → VERIFIED
Whiteboard: tiki_triage → tiki_test
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: