Active
Project:
Boost
Version:
6.x-1.18
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Jul 2011 at 07:15 UTC
Updated:
21 Jul 2011 at 16:43 UTC
Hello!
I have "Notice: Undefined index: page_id in boost_expire_node()" in boost.module file
Besides a lot of other notices in this module I was confused with this
$GLOBALS['_boost_router_item'] = isset($GLOBALS['_boost_router_item']) ? $GLOBALS['_boost_router_item'] : _boost_get_menu_router();
$router_item = $GLOBALS['_boost_router_item'];
after that $router_item['page_id'] is used without any conditions for isset, so I assume function _boost_get_menu_router() should always return array with index 'page_id', but it's not
take a look on my menu item in hook_menu
$items['user/profile'] = array(
'title' => 'mymenuitemtitle',
'page callback' => 'mypagecallback',
'access arguments' => array('has account'),
'type' => MENU_CALLBACK,
'weight' => -49,
'file' => 'mymodule.pages.inc',
);
so in function _boost_get_menu_router() menu_get_item called at the beginning
and after 'page_id' added in following cases:
in other cases there won't any "page_id" in array
I made patch from netbeans in attachments. It doesn't contains path to file, so you should use it directly
| Comment | File | Size | Author |
|---|---|---|---|
| boost-module-boost-expire-node.patch | 801 bytes | chingis |
Comments
Comment #1
chingis commentedbtw, I did some fixes in module before to get rid of notices, so patch probably won't apply to you
but it's pretty simple and you can make it by your own
Comment #2
chingis commentedbtw, I have one more notice in function boost_put_db
Notice: Undefined index: page_id in boost_put_db()
Well, reason is similar, router_item won't have "page_id" according to _boost_get_menu_router if its not:
node page
taxonomy page
user page
views page
panel page
But probably that's my misunderstanding of how module works.
Waiting for your feedback, thanks!