hi,

after updating to todays dev build (from 6.x-1.x) I get

user warning: Table 'database.nodehierarchy_menu_links' doesn't exist query: SELECT plid, menu_links.mlid, link_title, depth, weight, parent_node.type as type FROM d6_menu_links LEFT JOIN nodehierarchy_menu_links nh_parent ON menu_links.mlid = nh_parent.mlid LEFT JOIN node parent_node ON nh_parent.nid = parent_node.nid WHERE module = 'nodehierarchy' AND router_path = 'node/%' AND parent_node.type IN ('book', 'page', 'story', 'tour2009') ORDER BY depth DESC, weight ASC in /.../drupal-6.12/sites/all/modules/nodehierarchy/nodehierarchy.module on line 1054.

the code has the table name hardcoded and therefore misses the prefixed existing table (d6_nodehierarchy_menu_links in my case)

the second JOIN "LEFT JOIN node parent_node" will also fail due to the same reason

Comments

ansorg’s picture

ok, there are more things hardcoded in this query that better should not.

I changed it to

                "SELECT plid, {menu_links}.mlid, link_title, depth, weight, parent_node.type as type FROM {menu_links}
                    LEFT JOIN {nodehierarchy_menu_links} nh_parent ON {menu_links}.mlid = nh_parent.mlid
                    LEFT JOIN {node} parent_node ON nh_parent.nid = parent_node.nid
                        WHERE module = 'nodehierarchy' 
                          AND router_path = 'node/%'
                          AND parent_node.type IN (". implode(', ', $type_names) .")
                     ORDER BY depth DESC, weight ASC"

and this seems to work now.

sorry, but I cannot provide this as a patch

ronan’s picture

Status: Active » Fixed

Oops, sorry about that.

Committed a fix. Should roll with the next dev.

Thanks

ronan’s picture

Looks like our messages crossed each other, and I had missed that last table reference. Committed a fix.

Thanks again.

ansorg’s picture

looks like you missed the first line

in nodehierarchy-6.x-2.x-dev.tar.gz from today (June 19.) I have

"SELECT plid, menu_links.mlid, link_title, depth, weight, parent_node.type as type

should be
"SELECT plid, {menu_links}.mlid, link_title, depth, weight, parent_node.type as type

thanks

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.