PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'node_view__product_display' for key 'name': INSERT INTO {page_manager_handlers} (name, task, subtask, handler, weight, conf) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5); Array ( [:db_insert_placeholder_0] => node_view__product_display [:db_insert_placeholder_1] => node_view [:db_insert_placeholder_2] => [:db_insert_placeholder_3] => panel_context [:db_insert_placeholder_4] => 1 [:db_insert_placeholder_5] => a:12:{s:5:"title";s:22:"Custom Product Display";s:9:"no_blocks";i:0;s:8:"pipeline";s:8:"standard";s:22:"body_classes_to_remove";s:0:"";s:19:"body_classes_to_add";s:0:"";s:6:"css_id";s:0:"";s:3:"css";s:0:"";s:8:"contexts";a:0:{}s:13:"relationships";a:0:{}s:4:"name";s:15:"product_display";s:6:"access";a:2:{s:7:"plugins";a:1:{i:0;a:4:{s:4:"name";s:9:"node_type";s:8:"settings";a:1:{s:4:"type";a:1:{s:15:"product_display";s:15:"product_display";}}s:7:"context";s:25:"argument_entity_id:node_1";s:3:"not";b:0;}}s:5:"logic";s:3:"and";}s:3:"did";s:1:"2";} ) in drupal_write_record() (line 7239 of /var/www/mysite/htdocs/includes/common.inc).
| Comment | File | Size | Author |
|---|---|---|---|
| #32 | ctools-variant_cloning-2445203-32.patch | 1.29 KB | maximpodorov |
| #7 | error_cloning_variant-2445203-7.patch | 575 bytes | joel_osc |
Comments
Comment #1
dan_metille commentedGetting the same here.
Comment #2
damienmckennaThis was reported in the Panels Everywhere issue queue too: #2422189: Error when cloning a variant
Comment #3
damienmckennaAnother related issue, this time for Panelizer: #2445769: Unable to clone a display
Comment #4
damienmckennaComment #5
joel_osc commentedI think I may have an idea on this one. The following patch #813754-44: Ability to set variant machine name in Panels UI made some changes to how machine names are handled for tasks. It allows for a name to be passed in from the form instead of automatically generated. On cloning unfortunately the task name is identical to the variant being cloned which triggers the error. I briefly tested the following change to the clone/import code - adding lines 451 to 454 in page_manager.module:
Essentially this passes in a machine name if the title is available and nothing if a title is not available so that a unique name based on UUID will be created. I briefly tested cloning and importing and they seem to work, however I would like some thoughts or suggestions from others that may know this code a bit better before posting a patch.
Comment #6
lanceh1412 commentedI think you are right there. I don't know much about panels code but stepped through it yesterday and came to the same conclusion about where a fix was needed. I'll paste that code in and test it out.
Comment #7
joel_osc commentedI am going to move this to the ctools issue queue (hope that is okay!) since I believe the issue is in the page_manager code and provide a patch for the community to have a look at.
Comment #8
damienmckennaThat older project is the wrong one, this is the correct ctools ;)
Comment #9
damienmckennaComment #10
damienmckennaTrying to trigger the testbot.
Comment #11
damienmckennaCould you please test the latest -dev release, see if the problem persists?
Comment #12
damienmckennaFYI I tested this with the current -dev releases of Panels and CTools and wasn't able to reproduce the problem.
Comment #13
emcniece commentedStill hitting this with fresh dev versions of Panelizer, Panels, and ctools.
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'site_template__basic_sidebar_layout' for key 'name': INSERT INTO {page_manager_handlers} (name, task, subtask, handler, weight, conf) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5); Array ( [:db_insert_placeholder_0] => site_template__basic_sidebar_layout [:db_insert_placeholder_1] => site_template [:db_insert_placeholder_2] => [:db_insert_placeholder_3] => panel_context [:db_insert_placeholder_4] => -27 [:db_insert_placeholder_5] => a:12:{s:5:"title";s:20:"Basic Sidebar Layout";s:9:"no_blocks";i:1;s:8:"pipeline";s:8:"standard";s:22:"body_classes_to_remove";s:0:"";s:19:"body_classes_to_add";s:0:"";s:6:"css_id";s:0:"";s:3:"css";s:0:"";s:8:"contexts";a:0:{}s:13:"relationships";a:0:{}s:4:"name";s:20:"basic_sidebar_layout";s:6:"access";a:2:{s:7:"plugins";a:1:{i:0;a:3:{s:4:"name";s:5:"front";s:8:"settings";N;s:3:"not";b:1;}}s:5:"logic";s:3:"and";}s:3:"did";s:2:"18";} ) in drupal_write_record() (line 7261 of /var/www/clients/client0/web28/web/includes/common.inc).Comment #14
joel_osc commentedJust to confirm, I am still seeing it too on the latest dev:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'node_view__news' for key 'name': INSERT INTO {page_manager_handlers} (name, task, subtask, handler, weight, conf) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5); Array ( [:db_insert_placeholder_0] => node_view__news [:db_insert_placeholder_1] => node_view [:db_insert_placeholder_2] => [:db_insert_placeholder_3] => panel_context [:db_insert_placeholder_4] => 101 [:db_insert_placeholder_5] =>
The patch still applies on the latest dev and fixes the issue.
Comment #15
Anonymous (not verified) commentedThe patch in #7 worked for me: Chaos tools 7.x-1.7, Panels 7.x-3.5. I don't have Panelizer. I'm going to leave the status as it is—I'm pretty new to Drupal and am not sure I have sufficient expertise to test the patch.
Here's the error I was seeing previously:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'node_view__sandbox_node' for key 'name': INSERT INTO {page_manager_handlers} (name, task, subtask, handler, weight, conf) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5); Array ( [:db_insert_placeholder_0] => node_view__sandbox_node [:db_insert_placeholder_1] => node_view [:db_insert_placeholder_2] => [:db_insert_placeholder_3] => panel_context [:db_insert_placeholder_4] => 1 [:db_insert_placeholder_5] => a:12:{s:5:"title";s:12:"Sandbox view";s:9:"no_blocks";i:0;s:8:"pipeline";s:8:"standard";s:22:"body_classes_to_remove";s:0:"";s:19:"body_classes_to_add";s:0:"";s:6:"css_id";s:0:"";s:3:"css";s:0:"";s:8:"contexts";a:1:{i:0;a:4:{s:10:"identifier";s:19:"View: System Status";s:7:"keyword";s:4:"view";s:4:"name";s:35:"view:system_status-ctools_context_1";s:2:"id";i:1;}}s:13:"relationships";a:0:{}s:4:"name";s:12:"sandbox_node";s:6:"access";a:2:{s:7:"plugins";a:1:{i:0;a:3:{s:4:"name";s:5:"theme";s:8:"settings";a:1:{s:5:"theme";s:7:"working";}s:3:"not";b:0;}}s:5:"logic";s:3:"and";}s:3:"did";s:1:"9";} ) in drupal_write_record() (line 7261 of /var/www/html/includes/common.inc).Comment #16
matholum commentedSame thing for me as with #15. I'm using Chaos tools 7.x-1.7 and Panels 7.x-3.5 with nothing else. Once I learned how to patch it worked perfectly. Thanks for the fix! ^_^
Comment #17
damienmckennaI've confirmed that this patch resolves the problem for closing Panels Everywhere displays.
Comment #18
dillix commented#7 Fix issue for me, please commit it.
Comment #19
fluxline commentedworks for me, cheers.
Comment #20
joelpittetRTBC++
Comment #21
lwwalker commented#7 was working for me, but has since stopped. Has anyone else had the patch stop working? I've tried reinstalling the module and patching it again, but no luck.
Comment #23
japerryYup, tested this all week, looked good to me!
Comment #24
maximpodorov commentedOh, thanks a lot. With this bug, the following ugly workarounds were necessary:
http://cgit.drupalcode.org/entity_panels/commit/?id=cf7e65d
Comment #25
maximpodorov commentedThe patch doesn't fix the problem of cloning. The clone can have the same title as the original, so the name becomes the same as the original also.
Comment #26
maximpodorov commentedMoreover, when non-English letters are used for variant title, this title transforms into empty name which break cloning again.
Comment #27
damienmckenna@maximpodorov: I suggest creating a new issue for this problem.
Comment #28
damienmckennaFYI in the Panelizer world a patch was added to improve the cloning process: #2480999: Machine name on panlizer clone form doesn't autocomplete
Comment #29
maximpodorov commentedI think this problem can be solved here, it doesn't differ from the original description.
Comment #30
maximpodorov commentedComment #31
dillix commented+1
Comment #32
maximpodorov commentedThe patch solves the problem by checking new name existence in the DB.
Comment #33
juc1 commentedI am getting "PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry..." when cloning a variant. @ maximpodorov is your patch in in #32 in addition to the patch in #7 or instead?
Comment #34
lwwalker commented#32 confirmed works. Only #32, not in addition to #7.
Comment #35
maximpodorov commented#7 is already committed. Patch #32 is for the current dev branch.
Comment #36
sylus commentedThis patch worked for me as well and seems pretty reasonable to mark as RTBC given it just checks if name is being used and trims the possibility of the title beginning or ending with a '-'.
Comment #37
sylus commentedComment #38
mgiffordComment #39
japerryYah this (#32) seems like a decent incremental fix. Done.