When attempting to recreate features through the UI (that is, when I visit /admin/structure/features/FEATURE_NAME/recreate) on one of my sites, i sometimes get this fatal error:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'Advanced-filtered_html' for key 'PRIMARY': INSERT INTO {ckeditor_input_format} (name, format) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1); Array ( [:db_insert_placeholder_0] => Advanced [:db_insert_placeholder_1] => filtered_html ) in ckeditor_install() (line 54 of /home/steve/www/drupal_7/sites/all/modules/ckeditor/ckeditor.install).
Why on earth is ckeditor_install() being invoked here?
Also, this happens intermittently, but I'm not sure what magic ritual of cache clearing and feature reverting makes it go away.
Comment | File | Size | Author |
---|---|---|---|
#8 | pdoexception-2416907-9653587.patch | 843 bytes | rich.yumul |
Comments
Comment #1
steve.m CreditAttribution: steve.m commentedSo this appears to happen in features.export.inc at line 782 when features_get_default() decides to call
with $default_hook = 'install'
This seems like a bad idea?
Comment #2
hefox CreditAttribution: hefox commentedWhat is calling features_get_default with 'install'?
Comment #3
hefox CreditAttribution: hefox commentedComment #4
steve.m CreditAttribution: steve.m commentedSo far I've seen it happen with apachesolr and ckeditor. But then most of the time it works fine. I'll pull a backtrace next time I see it happen.
Comment #5
bbu23 CreditAttribution: bbu23 commentedsubscribe
Comment #6
hefox CreditAttribution: hefox commented@bbu23 you don't need to comment to subscribe, just press the link to follow to the right side.
Comment #7
rich.yumul CreditAttribution: rich.yumul commentedShould the _install hook be called when exporting features?
Or should ckeditor_install() do a check to see if the entries exist first?
What's the correct behavior supposed to be?
Comment #8
rich.yumul CreditAttribution: rich.yumul commentedHere's a patch that seemed to eliminate the issue. Can somebody check it out?
Comment #9
hefox CreditAttribution: hefox commentedThat's a bandaid patch -- I'd never add it features as it's covering up a bug instead of finding /why/ it's happening. that function shouldn't be called with 'install'.
Comment #10
baldwinlouie CreditAttribution: baldwinlouie commentedI had this issue happen to me. Its not a problem with the Features module. In my case, I found a contrib module that was declaring 'install' as the default hook in hook_features_api(). What you should do is to look at all the modules that are declaring hook_features_api() and see if it does something like this
Comment #11
dmsmidtThanks baldwinlouie, #10 was also the problem in my case (md_slider module).
Comment #12
vintorezxxi CreditAttribution: vintorezxxi commented@dmsmidt +1. Same happened to me.
Comment #13
hefox CreditAttribution: hefox at Phase2 commentedIs there a corsponding issue to fix this in the problematic module?
I sorta doubt more then 1 module has done this mistake
Comment #14
mcdoolz CreditAttribution: mcdoolz commentedSo was there a fix for this? I've happened upon the same error and have MD Slider installed, but I'm not quite understanding why it's appearing??
http://megadrupal.com/comment/3505
Comment #15
tomrogSo far, owners of MD Slider didn't care enough to update one line of code - we have to do it ourselves ;] The worst thing is that error points to CK Editor when infact is cause by MD Slider.
After uncommenting line with default_hook in MD Slider as suggested in comment from #14 link, the problem goes away ;)
Comment #16
ggevalt CreditAttribution: ggevalt as a volunteer commentedI want to confirm that the fix outlined in 14 and 15 works with one exception. I think tomrog meant to COMMENT out (or delete) the code line in mdslider.module as referred to in #14 link.
Thanks alot folks. This really helped.
cheers,
geoff
Comment #17
rprager CreditAttribution: rprager commentedI just ran into this issue with CKEditor, MD Slider, and Bootstrap Tour. I was able to workaround the issue by clicking the "Create Feature" tab from the main Features page. Without actually creating a feature, I then went back and was able to recreate features without the errors. I haven't had a chance yet to dig into the code to understand why this seems to resolve the issue.