Problem/Motivation
Since #3277784: copyRawVariables should support default route parameters, menu active trail information is missing under some conditions.
Specifically, if you define a view with a path and assign it a menu entry, the menu item no longer receives in_active_trail = TRUE when visiting that view path.
This issue was split from a broader regression in #3358402: [regression] route defaults are now automatically route parameters. Several comments in that issue explain how default parameters in route definitions affect menu link resolution.
-
@znerol:
$this->routeMatch->getRawParameters()->all()returns a different set of key-value pairs, which leads to an empty result fromloadLinksByRoute()inMenuActiveTrail::getActiveLink(). -
@lisotton:
I have routes with default parameters. After 9.5.9, calls like
loadLinksByRoute('news_list')require explicitly passing default parameters to find the menu link. This broke breadcrumbs and other features.
Steps to reproduce
- Log in as an administrator.
- Navigate to
/admin/structure/views/add. - Create a view with:
- View name: Site content
- Create a page: checked
- Create a menu link: checked
- Menu: Main navigation
- Visit
/site-content. - Inspect the menu item — it does not have the
primary-nav__menu-link--active-trailclass. - Comment out lines 71–75 in
ParamConversionEnhancer.phpto disable the change from #3277784: copyRawVariables should support default route parameters. - Rebuild caches and reload
/site-content. - The menu item does have the expected
primary-nav__menu-link--active-trailclass.
Proposed resolution
In MenuTreeStorage::loadByRoute() also query without any default route parameters as they may not be present in the computed route_param_key.
This required adding a route provider service dependency to the menu storage service and triggering a deprecation when the menu storage service is instantiated without the new dependency:
- In
MenuTreeStorage::__construct(), allow$route_providerto be omitted or passed as an array for backwards compatibility. This triggers a deprecation warning. - In
12.x, the method signature will be updated to requireRouteProviderInterfaceexplicitly and drop legacy support. - Update all internal usages of
MenuTreeStorageto pass the route provider explicitly. - The constructor for
WorkspacesMenuTreeStorageis also updated to pass the route provider explicitly.
Remaining tasks
- Open a follow-up MR against
12.xto:- Enforce strict
RouteProviderInterfacetyping inMenuTreeStorage::__construct(). - Remove all BC logic and deprecation handling.
- Enforce strict
| Comment | File | Size | Author |
|---|---|---|---|
| #155 | 3359511-155-11.3.x.patch | 41.28 KB | dafydd owen |
| #152 | 3359511-152-10.6.patch | 29.2 KB | jvandooren |
| #146 | current.png | 110.5 KB | trackleft2 |
| #146 | meanwhile.png | 106.53 KB | trackleft2 |
| #146 | previous.png | 117.13 KB | trackleft2 |
Issue fork drupal-3359511
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
Comment #2
wellsProviding a patch to revert #3277784: copyRawVariables should support default route parameters here as a short term workaround.
Comment #3
larowlanWe have two options here
\Drupal\Core\Menu\MenuActiveTrail::getActiveLinkor\Drupal\Core\Menu\MenuTreeStorage::loadByRoutecan filter out default params.Which would likely require using
\Drupal\Core\Routing\RouteProvider::getRouteByNameto load the route to get the defaults.Or alternatively
\Drupal\Core\Menu\MenuTreeStorage::preSavecould add in defaults prior to saveI'm thinking
\Drupal\Core\Menu\MenuTreeStorage::loadByRouteis probably the best place to do itThoughts?
Comment #4
quietone commentedChanging title per Special titles.
Comment #5
wellsHere's an initial attempt at the
\Drupal\Core\Menu\MenuTreeStorage::loadByRoutehandling recommended in #3.I fiddled with tests in
core/tests/Drupal/Tests/Core/Menu/MenuActiveTrailTest.phpbut had trouble getting the right pieces together. Figure we can leave tests until we are more sure about approach.Comment #7
roman.haluska commentedThanks a lot wells. The issue is also related to Menu block module because it also does not work if the Initial visibility level is set to higher than 1.
Patch works fine and solved my issue.
Comment #8
wellsThanks for testing, @roman.haluska. Be aware that some tests are still failing with the patch so you may face other regression. I haven't had the time yet to take a look at the fails.
Comment #9
larowlanWe will need a BC dance here, to check if the fourth argument is a string etc, someone could be sub-classing this
I'll work on this and the fails later in the week
Comment #10
larowlanComment #11
larowlanAny chance you're using taxonomy_menu here?
The fails indicate this breaks functionality for menu links created via the core UI, but the fix is needed (in my testing) for taxonomy_menu
I think the issue exists there, as it is hard-coding the route params to taxonomy_term only, which if you have views enabled breaks routing for views
Comment #12
larowlanEdit, it looks like #3358402-9: [regression] route defaults are now automatically route parameters has steps to test this with just core, I'll make a core test for that
Comment #13
wellsNot using taxonomy_menu and yeah those core repro steps are in this issue description as well.
Comment #14
glena commentedUnfortunately, at this stage, understanding many elements of this bug are beyond my capabilities, but I can confirm #3277784 caused a number of sections, on a site I manage, fail to render after upgrading to 9.5.9. Issue summary above seems to align with the problem I've encountered. Applying the reversion patch in #2 fixes all issues and I'll be using that so I can take the site to 9.5.9 for now.
Using patch #5 the missing sections of the site are rendering again, but the patch creates new problems with the site breadcrumbs. The site has both current_page_crumb and menu_breadcrumb installed and with patch #5 applied (no issues with #2 reversion applied) I'm getting duplication on the last breadcrumb entry and only on term pages. Sorry, I have not been able to isolate why.
Given upgrading from 9.5.8 (or prior) to 9.5.9 can result in parts of a page no longer rendering (causing a blocker to upgrade for some) is Normal Priority flag sufficient for this issue?
Comment #15
wellsThanks for sharing. This at least confirms my assumption that my attempted fix there has some issue. I'm at least going to remove that patch from display on this issue for now.
Comment #16
larowlan@wells, I wrote a test for this using your steps to reproduce, but it consistently passes.
So I tried the steps manually, and I can't reproduce, here's an example from Umami showing the menu link as active.
I'm using taxonomy menu and the issue comes from when you use that with views to generate the taxonomy page.
This approach should work for both taxonomy_menu and the expected behaviour in core for views.
I don't think it would be acceptable to put this into core until we can get steps to reproduce with just core.
Comment #17
larowlanHere's the patch to go with the interdiff above
Comment #18
larowlanah I started out with an OR and ended up with an IN, this can be simplified
In case there are multiple matches, go with the shortest one
This is the test case @wells mentioned in the other issue, this test passes and so does my manual testing
Comment #20
wells@larowlan I'm a little unclear on where/how I should be testing this. My test steps are from the 9.x branch and I can still reproduce this issue with the latest commits there. I'm not sure if this regression affects 10.x (and tangentially I'm unclear on what the 11.x branch is for).
Should I be testing from the 11.x branch? Would this not be addressed in 9.x with the upcoming EOL?
Comment #21
larowlan@wells 11.x is a bit like 'main' or 'master' in other branches. We've added it for now instead of a 'main' branch because there's a few things on d.o that don't support 'main' and expect versions to be named a certain way. We will eventually move to 'main' when those things are resolved.
We've made this change so that people don't have to constantly change the target of merge requests.
In terms of where you should be testing, the issue that caused the regression here went into all branches so I'd expect it exists in all three branches.
I was testing with 11.x, but I can repeat my testing on 9.5 in case it is unique to that version
Hope that helps
Comment #22
wells@larowlan thanks -- appreciate the explanations!
I'll try to get a test in with 11.x as well. Is it relevant that your new test failed (#19)?
Comment #23
larowlanI tested this in 9.5 and still could not replicate what you were seeing:
* Install Umami
* Add a new view, with a menu link
* Browse to that page, see the active menu trail on that link
The fail is odd
🤔
The test passes locally, so I'll need to dig into it a bit, could be down to things running in a subdir on the testbot
Comment #24
wells@larowlan could it be relevant I'm using the standard profile and not Umami?
I'll try Umami next...
Comment #25
wellsI can reproduce using just the Umami demo profile and it's default menu items.
Here is a menu item with no active trail from the current 9.5.x HEAD:
And here is the same environment with #3277784: copyRawVariables should support default route parameters changes reverted:
Comment #26
larowlanAh so I was looking at the styling, which both had the underline, I wasn't looking for the class.
I can take it from here - thanks
Comment #27
larowlantrying to fix the test first
Comment #28
larowlanThese should be red/green
Comment #29
larowlanFixed coding standards issues
Comment #30
larowlanComment #31
larowlanHiding old patches
Comment #33
smustgrave commentedAlso was able to verify on Umami install.
Patch #30 resolves the issue for me.
Comment #35
wellsOh damn I thought this already got committed, hah.
These test fails looked valid. Anyone on this issue know what they stem from?
Comment #36
hirakuro commentedHello, I think I'm facing a problem of this issue. But the patch of #30 not work for me.
So I tried to read records of menu_tree.
Data in 9.5.8 is below:
Data in 9.5.9 with patch #30, after
drush cache:rebuildis below:I'm using this "breadcrumbs" menu with menu_breadcrumb module and breacrumbs of my site by the module are currently broken, because SQL like `WHERE route_param_key = 'taxnomy_term_145'` in the module not working properly by this problem.
I think this expanding `route_param_key` is from #3277784 and it may be fixed #2 patch, but I did not try yet.
I'm afraid of applying #2 patch causing any other problems or conflict with internal data structure of future version of Drupal.
Could anybody give me some advice?
Comment #37
hirakuro commentedI'm sorry. The sql is executed in
MenuTreeStorage::loadByRoute()called by menu_breadcrumbs throughMenuLinkManager::loadLinksByRoute().Comment #38
larowlanNeeded to update new code in workspaces that sub-classes the menu tree storage service
Comment #39
smustgrave commentedVerified on Umami again and still seeing the fix.
Comment #40
pcate commentedRan into this today with some view pages. I'm running Drupal 10.1 so 10.x is affected by this as well. Patch #38 wouldn't apply to 10.1 for me, but #30 did apply and fixed the issue.
Comment #41
hirakuro commentedIn my case, finally I got this workaround.
Note that this includes a menu name for menu_breadcrumbs in my site, so you can not use this directly.
Comment #42
masipila commentedI was also hit by this as follows. I'm adding this comment here so that this kind of use case can be taken into account and as a courtesy to other community members who might have similar use case. I'm on 10.1 so I did not test patch #38 because as per #40, it won't apply to 10.1. I volunteer to test a new patch against 10.1 if there will be a patch that applies to 10.1
Context and use case
I have a custom module which creates competition menu links dynamically with plugin derivatives. "Competition" is a node content type specific to my site but the point here is that I'm dynamically adding competitions of the ongoing season to the menu.
My class
Plugin/Menu/CompetitionMenuLink extends MenuLinkDefaultand then the derivative classPlugin/Derivative/CompetitionMenuLink extends DeriverBase.My symptom was as follows:
view.competitions_current.page_1. I have this page view in my menu.Debugging observations
menuLinkManager->loadLinksByRoute($route)did not return the parent menu link anymore like it did earlier.menu_treetable in the database and observed that route parametersview_idanddisplay_idhad been added toroute_param_keyandroute_params.menuLinkManager->loadLinksByRouteresolved the issue for me.Cheers,
Markus
Comment #43
driskell commentedShouldn't this be only removing route keys which MATCH the default? Otherwise, if you pass in a route key, which HAS a default, but is not the default, this will then match routes in the table which are for the default value, not the given value? Perhaps I'm misunderstanding the logic but it seems this might be only meant to be removing if the value is default, not if it has a default.
Comment #45
jwilson3Expanding upon feedback from comment #40 above, I am experiencing this with Views pages that are listed as sub-menu items below top-level items in the main menu. In Twig menu--main.html.twig,menu.items[n].in_active_trailis not being activated for the parent menu item. Other sub-menu items that are not view pages do have the in_active_trail value set for the parent. I'm running Drupal 9.5.10 and the patch in #38 does not apply. On the other hand the patch in #30 does apply, but doesn't fix the issue. My workaround for now is to 1) convert the Views Page display to a Block display, 2) create a node with the desired path alias from the Page display, and 3) drop the View block onto the page — either via Layout Builder for the node or via Block regions in the theme with appropriate block visibility rule to restrict it to the desired path. Not an ideal solution, but it works.Edit: I discovered that the reason the active trail was not getting added to the parent was because the sub-manu items appeared in the main menu multiple times but several copies were "disabled" and/or located under other disabled top-level menu parents. Once deleting the dupes and cleaning out the menu, the active trail started working. the fact that these pages happened to be Views pages seems to have been a red herring.
Comment #46
rgeerolfWas also hit by this but my case is like described in #11 and #16. I have taxonomy_menu and my term page is generated from a view. So if I understand correctly in this case the issue is in Taxonomy Menu (#3376390) and not this core issue?
EDIT: Was using 'taxonomy/term/%taxonomy_term' instead of '/taxonomy/term/%' as view path so the view route was used instead of the canonical from the term. So my mistake, that fixed it for me.
Comment #48
larowlanCrediting stefan.butura from the duplicate #3388353: Active trail not calculated correctly for Views menu items
Comment #49
ever-c0deFully agree with #45. Have the same issue with active trail for menu items that duplicated multiple times ( they all are enabled ), some of them have 1 level in menu tree, some 2 ( all menu items located in `main` menu ).
Because of that, on node page for this menu item - I don't have second main menu that configured to show 2 level or greater.
Is there any quick solution for this (without deleting duplicates)? I've tried #30 on Drupal 9.5.1 but it's not work for me (patch applied but nothing changed).
Comment #50
jwilson3@ever-c0de Thanks for validating my bug from #45 in #49! What I haven't been able to identify is whether this part of the bug existed before the Drupal 9.5.9 update or not, which might help determine if this is part of the regression noted here, or it is a long standing bug that deserves a separate issue.
Comment #51
sagesolutions commentedI had do to the same thing as in comments from #42. Specifically, add in the view_id and display_id parameters.
Before:
$links = $this->menuLinkManager->loadLinksByRoute('view.courses.page_3', [], 'main');After:
Comment #52
nicolasgraphConcerning menu_breadcrumb, I posted a patch which does the trick for me.
Comment #53
nicolasgraphComment #54
ever-c0deI will provide a small update regarding #49. I fixed my own issue with active trail by decorating
menu.active_trailservice/Drupal/Core/Menu/MenuActiveTrail.phpand changedgetActiveLinkmethod to have last link from $links variable.This how it's looks:
Basically, i've just changed
$found = reset($links);from parent to$found = end($links);in my case. So, we receiving sorted by depth, weight and ID$linksarray from$this->menuLinkManager->loadLinksByRouteand in case we will have more than one link - the link with more depth will be active.Comment #55
tonytheferg commentedPatch helps me on 10.1.5 where in_active_trail was not getting called in my twig template.
Thanks!
Comment #56
2dareis2do commentedI have same or similar problem when adding a view to the menu via the Views UI where in_active_trail does not appear to be showing true.
Drupal 10.1.6
Adding via Menu UI works fine.
Steps to reproduce:
1. Set up a view
2. Add it to the main menu via the Views UI
3. On front end active class should be added to a href and list item
4. When walking through the code, notice how in_active_trail is set to false even it is currently in_active_trail
Screenshots here https://www.drupal.org/project/drupal/issues/3404791
Comment #57
fonant commentedFor what it's worth, the patch in #38 applies with a few small offsets to Drupal 10.1.7 and fixes the problem of active-trail not being applied to menus for View pages.
Comment #58
karlshea#38 works on 10.2.2 with a taxonomy menu
for the first set of terms, but does not work for nested terms.Edit: my mistake, I hadn't configured the taxonomy menu correctly and those terms didn't have menu items. The patch does work.
Comment #59
2dareis2do commentedWould be great to have this bug fix in next minor or patched version of Drupal.
Comment #60
2dareis2do commentedComment #61
lawxen commented#38 works for me.
Comment #62
catch@2dareis2do the patch here doesn't apply and there is no MR, so what is RTBC?
Comment #63
2dareis2do commentedComment #64
2dareis2do commented@catch sorry my bad. I thought I had the patch applied locally but I don't think I have.
Rerolled patch with correct path. Not sure if this has changed recently but seems to be consistent now between applying patch to core or contrib, i.e. relative. In this case relative to core
Comment #65
2dareis2do commentedComment #66
2dareis2do commentedComment #67
2dareis2do commented@catch, I am not sure why the latest patch is not applying.
Works fine for me locally.
My feeling is that the CI and subsequent tests are broken.
Comment #70
karlsheaCreated merge requests for 11.x and 10.2.x from patch at #38.
Comment #71
karlsheaSetting back to RTBC since there were no changes and the CI tests passing.
I'm not sure what the process is for removing BC changes (e.g. the route provider check in
MenuTreeStorageand test) but that check is still in the 11.x MR.Comment #72
quietone commented#3381929: Restrict access to empty top level administration pages for overview controller adds an @todo item to remove some fallback code once this issue is committed.
Comment #73
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #74
2dareis2do commentedComment #75
2dareis2do commentedswitching back to RTBC as this patch has been confirmed as working.
https://git.drupalcode.org/project/drupal/-/merge_requests/6493
Problem with CI bot?
Comment #76
andypostAs #72 and the issue commited first #3381929: Restrict access to empty top level administration pages for overview controller
Comment #77
nod_Comment #78
2dareis2do commented@andypost, please can you explain why you have changed this to needs work?
If I understand correctly, that change is dependent on this one being committed (merged)?
Comment #79
jonmcl commentedSorry in advance for the "noise" but can someone give a a summary of where things stand with this REGRESSION? I feel like it is not getting the proper attention from core maintainers that it should? Or am I wrong in that impression.
I see two MRs. One is marked for Drupal 10 and the other, I assume, is for Drupal 11? I suppose work has stopped completely on 9.5.x even though this regression was introduced in 9.5.9?
Also, I think there is still problem with menu items that reference a view that has a contextual filter. I recall others discussion that, but I don't know if it was in this issue or another.
-------
Update: my apologies for the rudeness of my message above. :)
Comment #80
xjm@JonMcL, thanks for asking about this issue. There are thousands of open core bugs, and thousands of potential core contributors -- including you. 🙂 We fix thousands of issues a year, but there are still many more out there. What gets fixed and when depends on contributors stepping up to complete the work needed to complete the issue.
Drupal 9 is end of life and insecure, so it does not receive any further commits. You should upgrade to Drupal 10 as soon as possible to avoid security vulnerabilities with your site.
All merge requests should be created against 11.x (which is our main development branch). We should close other merge requests that don't target 11.x. If and when this issue has a fix that is ready for commit, it will be committed to 11.x first, and then backported to the actively supported branches of core according to our backport policy. In the case of this particular issue, the fix appears to be complex and to require internal API changes, so it might be committed to minors only (which would mean it would be available in 11.1.0 and 10.4.0 if we manage to fix this in the next five months).
Some sites use composer-patches to run interim/partial fixes until a proper fix is available in a stable release.
Thanks!
Comment #81
2dareis2do commentedCan anyone explain why this has been set to needs work?
Patch here works for me without issue.
Comment #82
feyp commentedIt is needs work for comment #72.
Comment #83
wellsThe full #72 comment is:
I’m reading this as a task to be completed after “this issue is committed” (emphasis mine). How can the status of this issue be “needs work” when that work is meant to be done after the issue is committed? What actually needs to be done here?
Comment #84
wellsAh ok looking at the actual commit from #3381929: Restrict access to empty top level administration pages for overview controller it seems the work to be done here is to update the patch here to also remove this
ifblock: https://git.drupalcode.org/project/drupal/-/commit/02ca3176ead562c9e6175...Sorry, the wording of #72 was very confusing.
Comment #85
feyp commentedAlso proactively tagging for IS update, since we're missing a proposed resolution. Would be good to update the IS to the latest state before setting to needs review again as well, otherwise the issue will surely fail the review for that.
Comment #86
karlsheaComment #87
karlsheaComment #88
karlsheaMight just be tired but I'm failing to understand what is going on/what the request is for the @todo referencing this issue in
MenuAccessTest::testSystemAdminMenuBlockAccessCheck(), could someone take a look?@quietone, @wells I was also confused by #72 but removed the fallback code and rebased both MRs.
Comment #89
karlsheaCool. Doesn't apply to 10.3 now. Love these MR patches.Wrong issueComment #90
2dareis2do commentedPatch for 10.2 does not apply to 10.3 afaict.
After updating to 10.3.1, I am no longer sure if this patch is required?
Certainly the other dependent issue appears to be marked as fixed and has been closed.Disabling for now.
Comment #91
2dareis2do commentedre-rolling patch for 10.3
Comment #92
nicrodgers~2dareis2do - We are still using the patch from #30 in production on 10.3 . Haven't tried the newer patches.
Comment #93
2dareis2do commentedComment #94
2dareis2do commentedThanks @nicrodgers
One issue I appear to have with this patch is the active trail does not remain active if you click on a sub page or path.
e.g. If I have a view for /news the active trail shows if I click on the news page at /news, mark up looks like so
However if I then click on a sub page the active class is no longer applied. e.g. if i go to a page at /news/data-reveals-neighbourhoods-most-need-lifesaving-defibrillators the actual active class(es) seem to disappear. I am not sure this is correct.
e.g.
In this case the sub item is not in the menu path, but, it is still the active section.
Also, for me, the active class is being applied in bootstrap, which is what I have based my front end theme on. This will likely vary for others depending on your theme. In my case. e.g:
In this case the theme uses color (with no opacity) to set the visual active state. This is triggered by the use of the active class on the a link/href item.
Comment #95
2dareis2do commentedAlso, I have set up a home page content type and set this for my home page. One benefit of this approach is that I can set meta data on the node and also upload any required media etc there. However, I notice that if active, this only uses that
is-activeclass.I am a little confused why this is.
Ok so in web/core/includes/theme.inc
we have
In my case
is-activeclass is only being applied to li elements.Comment #96
2dareis2do commentedAlso adding the following css:
is-activeseems to be applied more consistently.There are exceptions. e.g. for me /user does not have active or is-active class applied. That is complicated by the fact that the path is /users/[myuser] despite the menu item for login being user. Still, at least the login path respects the is active trail. Modifying login markup like so in my theme:
Comment #97
2dareis2do commentedtbh I am not sure why /user gets redirected to /users/ ?It's possible to disable user redirect from path aliases.
That said, it still redirects user from /user/ to user/# so same problem with sub paths
ok turns out that I can use https://www.drupal.org/project/menu_trail_by_path
Comment #98
tonytheferg commented#38 no longer apply to 10.3.5
Comment #99
fonant commentedPatch #91 applies OK, and fixes the problem for me, thanks!
(You have to apply it in
drupal/web/core)Comment #100
drupalninja99 commentedAttach a patch that is a re-roll of #30 to latest 10.3.x (ie 10.3.5). This applied for me correctly, but note it does not include the workspaces patch.
Comment #101
acRerolling 100 for latest 10.3.x
Comment #102
acRerolling 100 for latest 10.4.x
Comment #103
acFixing #102
Comment #105
mradcliffeRebased 3359511-regression-missing-menu onto latest 11.x
Comment #106
mradcliffeI'll set to Needs review to get further review on the deprecation message.
Comment #107
nwoodland commentedPatch from #103 fixed the issue for me on Drupal 10.4. Thanks all.
Comment #108
mradcliffeRebased again as #3487851: Replace \PDO::FETCH_* constants to indicate fetch mode with an enumeration was merged.
Comment #109
mradcliffeFailing tests:
-
Drupal\Tests\file\Functional\DownloadTest::testPrivateFileTransferWithoutPageCache()- This seems like the approach/resolution may have a security-related issue.
-
Drupal\Tests\standard\FunctionalJavascript\StandardPerformanceTest::testAnonymous()- The test assertion should be updated.
-
Drupal\Tests\settings_tray\FunctionalJavascript\SettingsTrayBlockForm::testBlocks()- Seems to be consistently failing with the patch/merge request.
Comment #110
carolpettirossi commentedI've just tested MR 6493 and it has solved my issues.
I was getting the message "You do not have any administrative items." on my route:
Thanks for fixing this!
Comment #111
xjmAmending attribution.
Comment #112
jaroslav červený commentedI reworked patch #103 for Drupal 11.2.2
Comment #114
trackleft2I've updated the PHPUnit test in order to pass.
Also ran the test only changes.
Comment #115
trackleft2I've created a patch for 10.4.x without fixing some of the tests available here.
Comment #116
trackleft2Need to update the Merge request against 11.x so that the PHPUnit tests pass and change the deprecation target to the next minor 11.3 and the removal as 12.
Comment #117
trackleft2I've updated the change record to show a code example, and changed the deprecation target and removal version numbers to reflect updated code.
See https://www.drupal.org/node/3364323
Comment #118
trackleft2Update summary:
MenuTreeStorage:$route_providerparameter to acceptRouteProviderInterface|array|nullfor backwards compatibility.$options) or omitting the parameter entirely.12.x.WorkspacesMenuTreeStorage::__construct()to pass the route provider explicitly to match the parent constructor changes.MenuTreeStorageTest.Comment #119
trackleft2Comment #120
joegraduateRestored original proposed resolution and added some additional details to the issue summary.
Comment #121
trackleft2Adding patch that doesn't update tests
Comment #122
drupalfan2 commentedPatch #115 works for me (using Drupal 10.5.2).
Comment #123
jamesoakleyPatch at 121 applies against 11.2.5, and solves the problem.
Is there a reason why this cannot be moved to RTBC? Multiple people report this solves their problem.
Comment #127
godotislateLooks like MR 6492 needs to be rebased for merge conflicts, then someone needs to review the MR.
Comment #129
jamesoakleyI think #128 has put this into the MR
Comment #130
pcate commentedApplied MR #6493. Applied without conflicts and resolved issue.
Comment #131
jamesoakleyCorrect me if I'm wrong, but MR 6493 doesn't include the work above (especially #121) to make this work with Drupal 11.
@pcate, did you apply MR #6493 to a Drupal 11.x site with success?
Comment #132
mradcliffeThe tests are failing on merge request #6493 so this needs to be back to Needs work.
Comment #133
jamesoakleyThat's because MR #6493 is based against Drupal 10 code.
The code to review was MR #6492.
Comment #134
mradcliffeSorry, I typoed the MR I was referencing. 6492, the MR for Drupal 11, is failing tests so this should be Needs work.
Comment #136
mradcliffeI added a couple of tags and left a review comment on the merge request 6492 to replace the use of deprecated annotations with the noted PHP attributes in order to get the tests to complete again.
I reviewed the remaining tasks in the issue summary and updated them because there is a kernel and functional test now.
After fixing the merge request, if the next step is unclear, please remove the Novice tag.
Comment #137
rodrigoaguileraHello @marcoliver
Are you working on this in Vienna as part of the mentored contribution?
Comment #138
marcoliverOops, no, sorry! Hadn't seen that this had been tagged for Vienna. I'll stay off it for now.
Comment #139
mradcliffeThank you for updating the merge request, @marcoliver.
The tests and test results are running again for 11.x, and BreadcrumbTest is failing so this is still Needs work. I removed the Novice tag for now as that task has been resolved.
Comment #141
casey commentedSnapshot of latest state of MR for safe usage with composer patches on D11.3+ projects
Comment #142
casey commentedSnapshot of latest state of MR (without tests) for safe usage with composer patches on D11.2 projects
Comment #143
joegraduateAttaching current MR diff as patch usable with composer patches for 11.3.x.
Comment #144
mradcliffeThank you, @casey and @joegraduate. Everything is green now so I think this is RTBC again.
Comment #145
nicrodgersMR 6942 has merge conflicts that need resolving
Comment #146
trackleft2I've resolved the merge conflict in !MR6942 and set this back to needs review.
For the merge conflict I referenced this commit https://git.drupalcode.org/project/drupal/-/commit/223992a21c0d1e976f53d...
Previous versions of this PR attempted this change:
Commits to 11.x while this MR was stuck in review.

See https://git.drupalcode.org/project/drupal/-/commit/223992a21c0d1e976f53d...
The current version looks like this

Hopefully the screenshot help everyone understand my changes. I did not test with any other number, but all tests currently pass See https://git.drupalcode.org/issue/drupal-3359511/-/jobs/7866723#L307
Comment #147
mradcliffeThank you for making the change. I also noticed that we were decreasing by 1 the number of queries in that test.
Changing back to RTBC.
Comment #150
alexpottThe branch does not apply to main.
Comment #151
godotislateSome comments on the MR to address while fixing the merge conflict. The deprecation version also needs to be bumped to 11.4.0.
Comment #152
jvandooren commentedNeeded a fixed D10 patch. This is based on the 10.4.x branch of the D10 issue fork but also applies on D10.6.
Comment #154
dafydd owenI have rebased MR !6492 onto the current main branch.
As this is my first time working on a core issue, I accidentally rebased on the fork's 11.x branch initially, which has caused some history noise. Sorry about that.
Comment #155
dafydd owenAlso here's a patch that targets 11.3.x
Comment #156
jklmnop commentedEdit: I managed to get it applied to 11.3.9.
I'm having trouble applying #155 to 11.3.8 and
11.3.9.from
composer install -vvv