Null warning on end() Breadcrumb won't display correctly for role without proper permission

Created on 23 February 2021, over 3 years ago
Updated 5 October 2023, about 1 year ago

Problem/Motivation

  • Warning:end() expects parameter 1 to be array, null given 於 _entityqueue_set_breadcrumb() (/var/www/docroot/sites/all/modules/contrib/entityqueue/entityqueue.module 中的第 1209 行)。
  • This is cause by populating breadcrumb menu links which aren't accessible by the current user in whilst other links are. The inaccessible links returns NULL on end($menu_item['map']).

    Steps to reproduce

    1. Create contents and assign entityqueue.
    2. Allow a new role to control access of entityqueue without giving the accessibility of other admin menu.
    3. Masquerade as new role.
    4. Enter the "Edit items" page of an entityqueue edit page. ( ex:
    admin/structure/entityqueue/list/entityqueue_block_custom/subqueues/1/edit?destination=admin/structure/entityqueue).
    5. See error message

    Proposed resolution

    Add condition to check if $menu_item['map'] and $last_item exists.

    🐛 Bug report
    Status

    Fixed

    Version

    1.0

    Component

    Code

    Created by

    🇹🇼Taiwan g-brodiei

    Live updates comments and jobs are added and updated live.
    Sign in to follow issues

    Comments & Activities

    Not all content is available!

    It's likely this issue predates Contrib.social: some issue and comment data are missing.

    Production build 0.71.5 2024