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
Comment #1
mkalkbrennerI 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())?
Comment #2
rgarand commentedGood 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.
Comment #3
mkalkbrennerComment #4
mkalkbrennerI still can't reproduce that issue. Feel free to re-open it, if it happens again.