Closed (fixed)
Project:
Menu Rules
Version:
7.x-1.3
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Aug 2013 at 16:35 UTC
Updated:
13 Aug 2013 at 19:20 UTC
I installed the module and created a new menu and got the error. Rewriting line 21 to use empty() rather than is_null() solves the problem since empty will return true if the array key doesn't exist as well as if the value of the array key is null.
before:
/**
* Implements hook_menu_link_alter().
*/
function menu_rules_menu_link_alter(&$item) {
if(is_null($item['weight'])) {
$item['weight'] = 0;
}
}
after:
/**
* Implements hook_menu_link_alter().
*/
function menu_rules_menu_link_alter(&$item) {
if(empty($item['weight'])) {
$item['weight'] = 0;
}
}
Comments
Comment #1
ordermind commentedThanks, it will be fixed in the next development release.
Comment #2
ordermind commented