After installing themekey, we started seeing errors when cloning nodes using the node_clone module. When saving the cloned node, themekey_ui_node_insert() in themekey_ui.module has an error because it attempts to insert a duplicate primary key in themekey_ui_node_theme. We implemented a temporary workaround to check if the row existed before inserting, and did not check why this is apparently being called twice with the same information.

Comments

mkalkbrenner’s picture

I reviewed the code. It doesn't look like ThemeKey's fault. Can you post a stack trace (by adding debug_print_backtrace() to themekey_ui_node_insert())?

rgarand’s picture

Good point - I did a backtrace and on the first call it shows that themekey_ui_node_update calls themekey_ui_node_insert, while on the second call themekey_ui_node_insert is called directly. It looks like hook_node_update is being run first, but I'm not sure why. This error happens only when using node_clone and only with certain nodes.

mkalkbrenner’s picture

Title: Themekey causes fatal error with node_clone module » node_clone module causes fatal error in combination with ThemeKey
Version: 7.x-2.3 » 7.x-2.x-dev
mkalkbrenner’s picture

Status: Active » Closed (cannot reproduce)

I still can't reproduce that issue. Feel free to re-open it, if it happens again.