We have a menu enabled to support menu_minipanels and for a couple of the menu items in this menu, we have them set to use a minipanel (i.e. typical menu_minipanel use case). Inside each of the mini panels, we have a menu pane to a different menu (i.e. it's not recursive).
It renders, all fine, and everything is cool, until something runs drupal_flush_all_caches(). After the caches are flushed, the next page load, displays the following SQL exception, likely due to the caches being rebuilt:
PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')) ORDER BY p1 ASC, p2 ASC, p3 ASC, p4 ASC, p5 ASC, p6 ASC, p7 ASC, p8 ASC, p9 ' at line 2: SELECT ml.*, m.load_functions AS load_functions, m.to_arg_functions AS to_arg_functions, m.access_callback AS access_callback, m.access_arguments AS access_arguments, m.page_callback AS page_callback, m.page_arguments AS page_arguments, m.delivery_callback AS delivery_callback, m.tab_parent AS tab_parent, m.tab_root AS tab_root, m.title AS title, m.title_callback AS title_callback, m.title_arguments AS title_arguments, m.theme_callback AS theme_callback, m.theme_arguments AS theme_arguments, m.type AS type, m.description AS description FROM {menu_links} ml LEFT OUTER JOIN {menu_router} m ON m.path = ml.router_path WHERE (ml.menu_name IN (:db_condition_placeholder_0, )) ORDER BY p1 ASC, p2 ASC, p3 ASC, p4 ASC, p5 ASC, p6 ASC, p7 ASC, p8 ASC, p9 ASC; Array ( [:db_condition_placeholder_0] => <li class="first leaf"><a href="/executive-team">Executive Team</a></li> <li class="leaf"><a href="/organisational-structure">Organisational Structure</a></li> <li class="leaf"><a href="/strategic-plan">Strategic Plan</a></li> <li class="last leaf"><a href="/office-and-locations">Office and locations</a></li> ) in _menu_build_tree() (line 1438 of ##\includes\menu.inc).
I haven't given up trying to work this out myself, but thought I'd start by posting something to see if any others have the same error, or perhaps, I'm doing something unusual with my menus?
Comments
Comment #1
damienmckennaThat query makes no sense - the WHERE-IN part is expecting two arguments but only one is passed, and the argument is a compiled list, not a menu's internal name. Try installing the Devel module and adding ddebug_backtrace() to just before that query, see if you can work out where the query is coming from. Either way, I really doubt this is something Menu_MiniPanels is doing.
Comment #2
alexkb commentedLikely, but I can only trigger it when using menu_minipanels, so it's a starting place for the issue to be moved to a different issue queue later i guess.
I've been debugging the issue, and it specifically happens, when the menu_minipanel menu pane is attempted to be rendered and instead of being passed the menu name to the menu_build_tree() function, it gets passed an array of the menu items.
Will post back shortly, hopefully with an explanation.. possibly it's something silly I've done somewhere.
Comment #3
damienmckennaI look forward to what you find, if there ends up being some weird combination of things I'm happy to help build patches for other modules or add some Known Issues items to for the module.
Comment #4
alexkb commentedYou were right @DamienMcKenna, it had nothing to do with menu_minipanels. We recently created an admin theme called "admin". As a result, the menu theme function was looking for
_menu_tree which didn't exist in our "admin" theme, but did exist in the admin_menu module "admin_menu_tree", which was another module we used. That function accepts a menu name, not an array of the menu items tree though.
Thanks for replying back promptly anyway. Just glad was able to work it out eventually. Cheers.
Comment #5
damienmckennaGlad you were able to get to the bottom of it :)