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.

    Comments

    g-brodiei created an issue. See original summary.

    g-brodiei’s picture

    StatusFileSize
    new941 bytes
    new941 bytes

    Providing two patches to fix both 7.x-1.5 and current HEAD 7.x-1.x. respectively.

    g-brodiei’s picture

    Assigned: g-brodiei » Unassigned
    Issue summary: View changes
    StatusFileSize
    new11.73 KB
    new12.04 KB

    Manual testing on Ver. 1.5

    Before

    After

    Can see that non accessible links are shown as pure text for Roles without permission.

    • amateescu committed 375bde8 on 7.x-1.x authored by g-brodiei
      Issue #3199808 by g-brodiei: Null warning on end() Breadcrumb won't...
    amateescu’s picture

    Status: Active » Fixed

    The patch looks good to me, committed to 7.x-1.x, thanks!

    Status: Fixed » Closed (fixed)

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

    fernando iglesias’s picture

    Just a heads up, now on php 8.1 this warning has become a WSOD fatal error. Would be great to get a new D7 release!

    amateescu’s picture

    @Fernando Iglesias thanks for the notice! I released 7.x-1.6 for this :)