Problem/Motivation

After Drupal 11.2 update, I got errors when trying to edit the Administration menu (/admin/structure/menu/manage/admin):

  • Symfony\Component\Routing\Exception\RouteNotFoundException: Route "update.theme_update" does not exist.
  • Symfony\Component\Routing\Exception\RouteNotFoundException: Route "update.module_update" does not exist.

Theses errors seem to come from the /admin_toolbar/admin_toolbar_tools/src/Plugin/Derivative/ExtraLinks.php file at lines 504+ and 516+
They seem related to changes in D11.2 regarding module and theme update pages being removed, see change record:
The UI for updating modules and themes via the admin interface has been removed

Proposed resolution

For testing purposes, commenting these blocks of code in the aforementioned file gives back access to the Admistration menu:

@line 504:

      $links['update.module_update'] = [
        'title' => $this->t('Update'),
        'route_name' => 'update.module_update',
        'parent' => 'system.modules_list',
      ] + $base_plugin_definition;

@line 516:

      $links['update.theme_update'] = [
        'title' => $this->t('Update'),
        'route_name' => 'update.theme_update',
        'parent' => 'system.themes_page',
      ] + $base_plugin_definition;

Should they be removed?

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

phily created an issue. See original summary.

phily’s picture

Title: D11.2: update.theme_update and update.module_update no more exist » D11.2: update.theme_update and update.module_update routes no more exist
phily’s picture

Patch attached for testing purposes

phily’s picture

Issue summary: View changes

phily’s picture

Status: Active » Needs review

MR for review

anybody’s picture

Version: 3.6.1 » 3.x-dev
Status: Needs review » Reviewed & tested by the community

Thanks!

Here's the core change record: https://www.drupal.org/node/3511861

benjifisher’s picture

Status: Reviewed & tested by the community » Needs work

I am setting the status back to NW. See my comments on the MR.

phily’s picture

@benjifisher: perfect thought but why checking for Drupal version? isn't verifying the route existence enough?

EDIT: makes sense with other $links[] around edited code ;-)

benjifisher’s picture

why checking for Drupal version?

Just for consistency. If I were writing it from the start, I would only check for whether the route exists.

phily’s picture

Status: Needs work » Needs review
uv516’s picture

Drupal 11.2:
The patch helped me.

uberhacker’s picture

StatusFileSize
new1.86 KB

More elegant patch that should also work when the routes exist?

phily’s picture

StatusFileSize
new13.96 KB

@uberhacker: MR162 has already been upatded in this way for backward compatibility.

When using a patch with MR, get it from here: (see attached capture).

johnatas’s picture

Hey,

MR !162 tested successfully on Drupal 11.2.2 with Admin Toolbar 3.6.1.

Thanks,

mediameriquat’s picture

The patch #3 works, I can edit my Admin Menu. Thanks!

However, it seems some other "legacy" menus (i.e. Main Navigation) need to be uninstalled from the theme to perform the database update from Drupal 11.2.1 to 11.2.2.

johnatas’s picture

StatusFileSize
new3.53 KB

Hi @mediameriquat,

I believe the issue you're describing is the one that was reported in the thread of MR !162.
Patch #13 includes a conditional that should address it.

On my side, I created a patch based on MR !162 that works as expected — I'm attaching it to this comment.

dydave made their first commit to this issue’s fork.

dydave’s picture

Thanks a lot everyone for reporting this issue and all the great help working on the code changes and testing.

Sorry for the late reply... But it's been a rough couple of weeks work-wise 😅

The changes from the merge request seem very reasonable and accurate to fix this bug.

I have just added a commit to refactor a bit the calls to version compare.
I have tested the changes locally on a D11.2 and a D10.5 sites and they seemed to work as expected 👌

I would greatly appreciate if you could please help testing and reviewing the merge request.

We don't currently have tests for this part of the module, so once we're good with these changes, we should be able to get them merged 👍

Any comments, reviews or testing feedback would be greatly appreciated.
Thanks in advance !

dydave’s picture

dydave’s picture

Not sure why though .... But I'm not seeing the update.module_install and update.theme_install links on D10.5...

I wanted to check whether my last refactoring commit changed the display order of the menu items, but I was unable to find the links Install new module or Install new theme added by the admin_toolbar module....

Would anyone have any feedback on that ?

Otherwise, I'll take a bit more time later to look into this.

Thanks in advance!

dydave’s picture

OK, so I've checked these with a colleague and it would seem the install routes were dropped in D10.4 according to the change record The feature to install a new extension from a URL via the Drupal UI has been removed.

I understand better now, why I could not find the routes when testing with D10.4, D10.5 and D11.

So we should also probably update this compared version in the merge request as well.

I'll do a bit more tests to see if my latest commit changed the order of display of the links.

dydave’s picture

OK, I've tested this with D10.3.14 and the routes seem to be displaying in the same order before and after patch ✅
See screenshot below:

Screenshot of admin toolbar Update module Install and Update routes.

Upgraded to 10.4.8 and the install routes disappeared ✅

I didn't get any crash on the Edit admin menu page, since the existence of the routes is checked as well.

Therefore, I added an additional commit to update the version comparison for the install routes for 10.4, corresponding to change record The feature to install a new extension from a URL via the Drupal UI has been removed.

I've tested the changes locally myself with D10.3, D10.4, D11.2.2 and they seemed to work as expected 👌

At this point, the merge request should be pretty much ready to get merged, but let's get some more testing feedback and reviews, if possible, before effectively merging it.
Thanks in advance!

johnatas’s picture

Hi @dydave,
The latest version of the MR works as expected on my D11.2.2 project ❤️
Thanks for the work!

  • dydave committed 1e71df02 on 3.x authored by phily
    Issue #3532010 by phily, dydave, benjifisher: Dropped support for Core...
dydave’s picture

Status: Needs review » Fixed

Thanks a lot Sylvain (@johnatas) for the prompt and positive feedback, it's greatly appreciated! 🙏

Following your confirmation, I did a few more manual tests locally and since all the jobs and automated tests for the merge request were passing 🟢 , I went ahead and merged the changes above at #25 🥳
Great job everyone! 👍

As a follow-up to this issue, I created feature request #3536457: Provide extra links for the Automatic Updates module as an attempt to provide an "equivalent" to these extra links, which should most likely be supported by the Automatic Updates contrib module from now on.

At this point, since I don't see anything else outstanding, this issue could probably be considered as Fixed for now.

Feel free to let us know if we missed anything or if you would encounter any issues with any of the latest code changes, we would surely be glad to hear your feedback.
Thanks again everyone for the great work and help on this issue! 🙂

dydave credited tyb.

dydave’s picture

Crediting my colleague @tYb for his help fixing the version compare for the install routes.

marcelovani’s picture

Thanks for fixing this, can you please cut a new release?

dydave’s picture

Thanks Marcelo (@marcelovani)!

can you please cut a new release?

Is this super urgent, or could it wait a few weeks, around the 20th of August ? (Planned date for the next release)

Thanks in advance!

anybody’s picture

Anyone who needs it urgently may switch to 3.x-dev@dev (if project policy allows). Still I think this is an important fix justifying a release.

phily’s picture

StatusFileSize
new27.17 KB

Anyone needing the fixed code before the next release can use MR!162 diff file as a patch file.
Only local images are allowed.
Available before the first comment.

dydave’s picture

OK, no problem at all 👌

Let's keep releasing more regularly and we'll just postpone the next scheduled release.

This will take off some pressure and give us a bit more time to get some more issues included in the next planned release 👍

Therefore, I went ahead and created the new admin_toolbar-3.6.2 stable release 🥳

Feel free to let us know if you spot anything else with recent core versions or some change records we may have missed, we would certainly be happy to take a look.
Thanks everyone once again for the great help keeping the module well maintained! 🙏

Status: Fixed » Closed (fixed)

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