Clean Install (drupal 6.19) added WYSIWIG module and when configuring the client side editors and added Ckeditor to Filtered Input I get this error
user warning: Duplicate entry '2' for key 'PRIMARY' query: INSERT INTO wysiwyg (format, editor) VALUES (2, '') in /web/sites/all/modules/wysiwyg/wysiwyg.admin.inc on line 493.
Everything functions fine even though the error occurs, and the error does not show again.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | wysiwyg.940312.12.patch | 642 bytes | twod |
Comments
Comment #1
twodSounds like it tried to create an editor profile twice. Did you by any chance double-click the submit button when saving the settings (I'm assuming this is when it happened)?
Comment #2
twodCan you reproduce this on another clean installation?
Comment #3
seaslug commentedyip i don't often do a clean install but every time i have it has done it, again before i posted the first time, i did a clean install and received this error, as i said it does not stop anything from working, just raised it as a minor bug.
Comment #4
sunSorry, I just did the same and didn't get the error. Without further information this issue can only be closed as not reproducible.
Feel free to re-open this issue if you want to provide further information. Thanks.
Comment #5
dharmanerd commentedThis was a problem for me too! Aquia Drupal 6.22 w/ wysiwyg 6.x-2.4. So far it's only happened once (w/ two error messages) on the first attempt to configure ckeditor.
Duplicate entry '3' for key 'PRIMARY' query: INSERT INTO wysiwyg (format, editor) VALUES (3, '') in /var/www/vhosts/artjewelryforum.org/httpdocs/sites/all/modules/wysiwyg/wysiwyg.admin.inc on line 509.
Duplicate entry '1' for key 'PRIMARY' query: INSERT INTO wysiwyg (format, editor) VALUES (1, '') in /var/www/vhosts/artjewelryforum.org/httpdocs/sites/all/modules/wysiwyg/wysiwyg.admin.inc on line 509.
Comment #6
karol haltenberger commentedThis error - although not serious - is still present in 2.4 and is caused by the following:
When an editor is NOT selected for an input format, the $form_state['values']['formats'] array contains its entry with an empty value.
On line 508 this generates the query string "UPDATE wysiwyg SET editor = '' WHERE format = 1" (supposing the format'S id is 1).
If the format had no editor selected before, therefore its entry in the database is empty (''), MySQL will NOT update and the reported number of affected rows is 0.
This triggers line 510 which tries to insert the row, hence the error.
Quickfix:
wysiwyg.admin.inc, line 509:
Or maybe the whole update/insert section (lines 508-511) should be put in an if($values['editor'])){} block
Comment #7
twodThanks for the info and debugging work.
I don't have time to confirm this now but if someone does it'd be greatly appreciated.
Comment #8
chichilatte commentedI'm getting the same warning. D-6.22, Wysiwyg-6.x-2.4. I have 3 input formats, with the third (PHP code) having no editor selected.
user warning: Duplicate entry '3' for key 'PRIMARY' query: INSERT INTO wysiwyg (format, editor) VALUES (3, '') in /Users/Shared/projects/myproject/svn/published/sites/all/modules/wysiwyg/wysiwyg.admin.inc on line 509.(I tried giving the 'PHP code' input format an editor and the problem disappeared. However, there doesn't seem to be a way to undo the change! Ha!)
Not a showstopper, this bug, but looks a bit scary :)
Comment #9
twodIt looks a bit scary but it's nothing to worry about. For some odd reason, it's trying to recreate a "no editor for this format"-record.
If you've assigned an editor profile to a format and don't need it anymore, just click remove/delete in the right column. It won't touch your formats, just the editor profile.
Comment #10
dagomar commentedI got this error too. It's no biggie, it will only show up on admin pages, right?
Comment #11
spgd01 commentedI still get the error
Comment #12
twodI made a patch of Ypthor's change in #6. Could you please try it?
If I've understood it correctly, this only happens on D6, so the patch is for 6.x-2.x.
Comment #13
carwin commentedPatch applied cleanly, no errors in a clean environment.
Steps to produce error
Comment #14
summit commentedHi, working for me also.
Will this patch be committed please?
greetings, Martijn
Comment #15
twodI committed the patch from #12 to the 6.x-2.x and 5.x-2.x branches and credited Ypthor for finding the cause.
Development snapshots will be updated within 12hrs and the fix will be part of the next releases.
Thank you all for reporting, debugging and reviewing!