Problem with new menu

Created on 31 October 2022, over 1 year ago
Updated 2 March 2024, 4 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

Postponed: needs info

Component

Code

Created by

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 about 1 year ago
    Patch Failed to Apply
  • Status changed to Postponed: needs info 4 months 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!

Production build 0.69.0 2024