Compatibility with Admin Toolbar 3.6.0

Created on 31 May 2025, 24 days ago

Problem/Motivation

This is a follow up to initial issue reported in the Admin Toolbar project:
🐛 Upgrade version 3.5.3 to 3.6 crashes site Active
after upgrading to admin_toolbar-3.6.0 .

Steps to reproduce

Enable admin_toolbar_content-2.0.x-dev or 2.1.0, with admin_toolbar 3.6.0.
Browse to /admin/config/user-interface/admin-toolbar-content
Enable Content / Recent content and save the form at the bottom of the page

==> WSOD error:

ArgumentCountError: Too few arguments to function Drupal\admin_toolbar_content\Plugin\Menu\RecentMenuLinkEntity::__construct(), 4 passed in /var/www/html/web/core/lib/Drupal/Core/Menu/MenuLinkDefault.php on line 54 and exactly 5 expected in Drupal\admin_toolbar_content\Plugin\Menu\RecentMenuLinkEntity->__construct() (line 28 of /var/www/html/web/modules/contrib/admin_toolbar_content/src/Plugin/Menu/RecentMenuLinkEntity.php).

Proposed resolution

This seems to be due to the following change in the admin_toolbar module:
https://git.drupalcode.org/project/admin_toolbar/-/commit/4dc4d9104e256a...
Where the constructor was removed and its logic moved to the create method instead.

Consider doing the same for this module:

Move the logic from its constructor to its create method.

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Version

2.0

Component

Code

Created by

🇫🇷France dydave

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

Merge Requests

Comments & Activities

  • Issue created by @dydave
  • Pipeline finished with Success
    24 days ago
    Total: 160s
    #510673
  • Pipeline finished with Success
    24 days ago
    Total: 147s
    #510676
  • 🇫🇷France dydave

    Quick follow-up on this issue:

    Created the initial merge request MR !37 above at #2 which :

    Converts the __construct method to create and all the existing code or logic was kept pretty much "as-is".

    After testing the changes locally, the error disappeared and the expected menu items seemed to display properly under Content, for example: this patch should fix the fatal error.👌

    Moving issue to Needs review for now, as an attempt to attract more attention, reviews, testing and reporting feedback.

    Feel free to let us know if you have any questions on this issue or the changes suggested in the merge request, we would certainly be glad to help.
    Thanks in advance!

  • Thanks a lot, @dydave! Your patch for admin_toolbar_content works very well here!

  • Pipeline finished with Skipped
    22 days ago
    #512144
  • First commit to issue fork.
  • 🇧🇪Belgium kriboogh

    Thanks for the fix. I merged it.

  • 🇧🇪Belgium kriboogh

    Released in 2.1.1

  • 🇫🇷France dydave

    Wow Kris (@kriboogh), thanks a lot for the very quick feedback and follow-up on this! 🥳

    Since the module is marked Minimally maintained, I was certainly not expecting this fix to be merged so quickly.

    Thank you very much for the prompt, positive feedback and for creating a release right away.

    Thanks also for granting us (@dgwolf and I) the credits on the commit and this issue.
    Cheers!

Production build 0.71.5 2024