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

jojonaloha’s picture

Status: Active » Needs review
StatusFileSize
new867 bytes

Attached patch uses menu_unserialize() to replace path components in access arguments.

rodrigoaguilera’s picture

Status: Needs review » Reviewed & tested by the community

Works as expected and the code looks good

dave reid’s picture

Version: 7.x-3.x-dev » 8.x-3.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Tested and committed #1 to 7.x-3.x.

  • Dave Reid committed 2f4b8d6 on 7.x-3.x authored by jojonaloha
    Issue #2170873 by jojonaloha: Fixed field_ui_admin_menu_map does not...
sonicthoughts’s picture

I 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.

joelpittet’s picture

Notice: Undefined index: map in field_ui_admin_menu_map() (line 86 of admin_menu/admin_menu.map.inc)

.
Same with latest dev release.

joelpittet’s picture

truls1502’s picture

Status: Patch (to be ported) » Fixed

This 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.

Status: Fixed » Closed (fixed)

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