Active
Project:
Node Hierarchy
Version:
7.x-2.x-dev
Component:
Drupal/PHP Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Jun 2011 at 13:30 UTC
Updated:
16 Jun 2011 at 13:32 UTC
When I create a page I can add it's link to the menu. I use dropdown menus for child pages so I would like to have the menu items expanded by default.
I can do it like this in my module.
/**
* Implement hook_node_presave
*/
function mymodule_node_presave($node) {
if($node->type = 'page' || $node->is_new) {
$node->menu['expanded'] = 1;
}
}But... Node Hierarchy module doesn't preserve the setting. The problem is in nodehierarchy.module in function _nodehierarchy_save_node.
This can be avoided by adding this before the actual saving:
// Ensure that created menu item will inherit expanded value.
$node->nodehierarchy_menu_links[$i]['expanded'] = $node->menu['expanded'];Sorry that I don't have a patch. I don't have properly configured environment at the moment.
Comments
Comment #1
jiv_e_old commented