When an entity uses a path component in the access argument, the argument is not replaced.
Example from the Entityqueue module:
$return['entityqueue_subqueue']['bundles'][$name] = array(
'label' => $queue->label,
'admin' => array(
'path' => 'admin/structure/entityqueue/list/%entityqueue_queue',
'real path' => 'admin/structure/entityqueue/list/' . $name,
'bundle argument' => 4,
'access callback' => 'entityqueue_queue_access',
'access arguments' => array('view', 4),
),
);
Currently when the access callback is called like: entityqueue_queue_access('view', 4); .
Instead, it should receive two arguments: "view" and the result of entityqueue_queue_load($name); .
This was discovered to be part of the cause for #2167037: Fatal Error encountered when adding a taxonomy queue
Comments
Comment #1
jojonaloha commentedAttached patch uses menu_unserialize() to replace path components in access arguments.
Comment #2
rodrigoaguileraWorks as expected and the code looks good
Comment #3
dave reidTested and committed #1 to 7.x-3.x.
Comment #5
sonicthoughts commentedI see many errors:
Notice: Undefined index: path in field_ui_admin_menu_map() (line 88 of home/xxxx/public_html/drupal/sites/all/modules/admin_menu/admin_menu.map.inc).
Should this patch be applied?
thx.
Comment #6
joelpittet.
Same with latest dev release.
Comment #7
joelpittetSeems to be related to #2502695: Undefined index map in field_ui_admin_menu_map() when clearing cache
Comment #8
truls1502This is already fixed and is in 7.x-3.x-dev from before.
Also, I have committed the #2502695: Undefined index map in field_ui_admin_menu_map() when clearing cache regarding the comment #7.