Problem with new menu

Created on 31 October 2022, over 2 years ago
Updated 6 September 2024, 7 months ago

Problem/Motivation

I enabled the module to display the content of my main menu in sitemap.
And after I created multiples menu by code (because my webmaster can create sub site ),
By default, the new menus are display in my sitemap.
Register the sitemap settings again in back end, without any change, fixed the issue.

Steps to reproduce

- Enable a menu and register sitemap.settings.
- Create a menu (in my case , per code).
- The front end contains the link of new menu.

It's because there is no plugin config in sitemap.settings for the menu, it inherists the plugin from the previous menu in plugins_config array.

Proposed resolution

In modules/contrib/sitemap/src/Controller/SitemapController.php line 74
$plugin_config is not properly reset and get an enabled by default ( see my screenshot with xdebug: https://ibb.co/Jy2Z8bQ) , it's the config of my main menu.

If I reset the variable $plugin_config in the foreach, the issue is fixed.

Here a patch that works for me.

🐛 Bug report
Status

Closed: cannot reproduce

Component

Code

Created by

🇫🇷France tichris59

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.1 & MySQL 8
    last update almost 2 years ago
    Patch Failed to Apply
  • Status changed to Postponed: needs info about 1 year ago
  • 🇨🇦Canada mparker17 UTC-4

    This looks great, but the code that you changed in your patch was also changed in #3231515: Save settings of enabled plugins only , and I suspect the change may have fixed the issue that you were having.

    Can you confirm whether you are still seeing this behavior on the latest version of the Sitemap module? If so, then please set this issue "Status" back to "Needs review", and the "Version" to "8.x-2.x-dev". (This is likely something we will want to prioritize for the 8.x-2.0 release ( 🌱 [Plan] Stable 8.x-2.0 release Active )).

    If not, then please let us know it is working, and we will close the issue.

    Thank you very much in advance!

  • Status changed to Closed: cannot reproduce 7 months ago
  • 🇨🇦Canada mparker17 UTC-4

    This issue has been in "Postponed (maintainer needs more info)" status for more than 6 months without a reply, so I'm going to close this as "Closed (cannot reproduce)" to try to keep the issue queue tidy. Thank you in advance for your understanding!

    But please re-open this issue if you are still experiencing this issue!

Production build 0.71.5 2024