Maximum number of bundle sub-menus does not account for setting zero

Created on 11 December 2023, 12 months ago
Updated 14 February 2024, 9 months ago

Problem/Motivation

It is not possible to set zero ("0") in the Maximum number of bundle sub-menus to display setting in the Admin Toolbar Tools configuration. When zero is set, all bundle sub-menu items are displayed. The expected behavior would be that no bundle sub-menu items are shown.

Steps to reproduce

  1. Navigate to /admin/config/user-interface/admin-toolbar-tools
  2. Set Maximum number of bundle sub-menus to display to "0".
  3. Save the configuration.
  4. All bundle sub-menu items are shown.

Proposed resolution

Currently, ->pager() and array_slice are used to limit the respective menu items. These handle the zero-case differently. Therefore, we should introduce separate checks for the zero-case.

Remaining tasks

Review code changes.
Communicate change of behavior in release notes.

๐Ÿ› Bug report
Status

RTBC

Version

3.0

Component

Code

Created by

๐Ÿ‡ฉ๐Ÿ‡ชGermany simonbaese Berlin

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

Merge Requests

Comments & Activities

  • Issue created by @simonbaese
  • Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 8
    last update 12 months ago
    Waiting for branch to pass
  • Status changed to Needs review 12 months ago
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany simonbaese Berlin
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia prashant.c Dharamshala

    Prashant.c โ†’ made their first commit to this issueโ€™s fork.

  • Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 8
    last update 12 months ago
    Waiting for branch to pass
  • Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 8
    last update 11 months ago
    Waiting for branch to pass
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia prashant.c Dharamshala

    @simonbaese

    Made change to use !empty() . Please review.

    Thanks

  • Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 8
    last update 10 months ago
    Waiting for branch to pass
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany simonbaese Berlin

    Resolved all threads. Please test your suggestions before pushing code to the branch. Please review.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Sandeep_k New Delhi

    @simonbaese, I've tested the MR- MR !65 mergeable on the Drupal - 10.2 version, the patch was applied successfully. After applying the patch, the issue was fixed partially for me, The issue was fixed for the "Structure menu's" list but not applied on other menus- sharing attached before & after results for reference-

    Testing Steps:

    • Enable/Install Admin Toolbar Module.
    • Go to> Admin>Configuration/User interface/Admin Toolbar Tools settings-
    • Set the value of 'Maximum number of bundle sub-menus to display' to 0 & save.
    • Check the Menus for the applied changes- Added Before Results.
    • Download the Patch & Apply.
    • Check the Menus after applying the Patch- Added After Results.
  • Status changed to Needs work 10 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Kanchan Bhogade

    Hi
    Tested MR !65 on the drupal 10.2
    The patch applied successfully...

    Test Result:
    The issue fixed partially using the MR !65
    After the patch fix is applied for Structure some menus and other menus are not fixed.

    Attaching screenshot for reference
    #7 comments
    Moving to "needs work"

  • Status changed to Needs review 10 months ago
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany simonbaese Berlin

    @Sandeep_k & @Kanchan Bhogade Please read the issue description carefully. This issue aims to fix a bug in the current implementation. It does not intend to extend or change the menu behaviour. The max bundle number setting is currently not used for user bundles. Please open another issue, if you like to change that and do not bloat this issue. Please describe the expected behaviour when posting screenshots. Especially the second set of screenshots it is not clear.

  • Status changed to RTBC 9 months ago
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany marcoliver Neuss, NRW, Germany

    Looks good to me! The issue fork solves the problem described in the issue body.

    Comments #7 and #8 may be valid, but are out of scope for this task.

    Marking RTBC.

Production build 0.71.5 2024