Postponed (maintainer needs more info)
Project:
Sitemap
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
2 Oct 2019 at 14:12 UTC
Updated:
21 Jul 2025 at 10:55 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
Sbonder commentedComment #5
akalata commentedThanks, I've committed this to 8.x-1.x as well.
It would be great if we could add a test for it, so I'm going to leave the issue open for now.
Comment #6
akalata commentedAha, I didn't see that this patch relies on the Menu Manipulator module. I'm going to revert these commits for now, and take another look after reading through #2466553: Untranslated menu items are displayed in menus.
Comment #9
simon georges commentedWith the patch from #2466553-75: Untranslated menu items are displayed in menus, the needed patch for sitemap module seems to be this one, it works on my website.
Comment #11
odai atiehComment #12
akalata commented#11 would be for 8.x-1.x.
#9 is a great solution if using Menu Manipulator.
The core issue (#2466553: Untranslated menu items are displayed in menus) on its own doesn't appear to be enough yet to fix this.
Comment #13
mparker17This sounds more like a feature request than a task to me.
It would be good to know if this is still an issue on Drupal 10, running the latest sitemap version.
(I'm cleaning up old issues as part of a big review of open issues for #3425146: [Plan] Stable 8.x-2.0 release: thank you for your patience with me)
Comment #14
berramou commentedHello,
yes this is still an issue on Drupal 10.2.X with the 8.x-2.0-beta6 version.
I attach new patch that fix this issue.
Comment #15
mparker17Moving to "Needs review" so I remember to review the new patch
Comment #16
mparker17The patch in #14 introduces an implicit dependency on the menu_manipulator module, which isn't ideal, so I can't merge patch as-is (see below for more information about why).
That being said, I see a way to write this patch so that menu_manipulator is an optional dependency...
... but — as mentioned before — I don't want to merge anything that doesn't include tests, otherwise we won't know if future changes to the sitemap module will break your website!
To write tests for this feature, start by adding menu_manipulator as a test dependency: this ensures that it will be available in the test environment...
Then add a Functional test for the functionality. It will look something like the following...
... you'll have to fix the TODOs, and test it to make sure that the tests pass with the patch in place.
Aside, in the interest of being transparent, I considered several paths forward:
sitemap.info.yml)I ultimately settled on the last option.
Comment #17
mparker17Adding "Needs tests" tag.
Comment #19
mparker17I've converted the patch in #14 into a merge request, and I made the changes I requested in the first part of #16, but, when I installed menu_manipulator-3.1.0 or menu_manipulator-4.0.0 (I tested both), when I go to
/sitemap, I get a WSOD, and the error...... and I'm not sure where to go from here, because I don't think I understand the Steps to Reproduce!
Here's what I did to test...
I started by setting up a test environment.
git clone --branch '8.x-2.x' https://git.drupalcode.org/project/sitemap.git && cd sitemap— cloned this modulegit remote add sitemap-3085218 https://git.drupalcode.org/issue/sitemap-3085218.git && git fetch sitemap-3085218 && git checkout -b '3085218-filter-menu-tree-by-language' --track sitemap-3085218/'3085218-filter-menu-tree-by-language'— switched to this issue's branchddev config --project-type=drupal --docroot=web --php-version=8.3 --corepack-enable --project-name=sitemap— set up a ddev site for testing the module in isolationddev add-on get ddev/ddev-drupal-contrib— installed the very-handy DDEV Drupal Contrib add-onddev startcomposer.json, added"drupal/menu_manipulator": "^4"(later I tried^3) to therequire-devsection for testing purposesddev poser— run composer-install as per the ddev-drupal-contrib setup instructionsddev symlink-project— link the module into place as per the ddev-drupal-contrib instructionsddev drush -y si demo_umami— install Drupal with the Umami Food Magazine demo content — normally I use the minimal install profile, but I know the Umami demo is a multilingual site, so I figured it would be a good test case for this issue.ddev drush -y en sitemap— enable the sitemap moduleddev drush -y uli— get a login link; pasted in browserThen I set up the site...
/en/admin/config/search/sitemapand enabled theMenu: Main navigationand left its configuration at the defaults./en/admin/structure/menu/manage/main. I saw that the Menu language =English. It struck me that maybe you're intended to use entirely different menus in each language, but the issue summary and discussion in this ticket seemed to imply that there were menu items for more than one language in the same menu, so I went to figure out how to do that.<front>,/en/articles, and/en/recipes)./en/admin/config/regional/content-languageto check out the settings there. The Custom menu link entity-type was not set to be translatable, so I checked it to make it translatable. I left most configuration in the Custom menu link details element at the default values, but I unchecked "Changed" because it didn't seem like that needed to be translatable. I clickedSave configurationon that page./en/admin/structure/menu/manage/mainand edited a custom menu link. Now I could see the language selector. I also saw a Translate tab./en/sitemap, and/es/sitemapin a separate tab. To my surprise, I saw the English translations for the menu items on the English sitemap, and the Spanish translations for the menu items on the Spanish sitemap. It strikes me that making Custom Menu Links translatable, and adding translations for them might be a more-sustainable work-around for some sites. That being said, I'm aware of long-standing bug #2466553: Untranslated menu items are displayed in menus, and I have also worked on highly-localized sites where there completely different content in different languages, down to different menu structures and orders, so I'm aware this won't work for everyone./en/admin/modulesand enabled theMenu Manipulatormodule./en/sitemap, and/es/sitemapto see if it made the untranslated menu links go away. This is when I got theInvalidArgumentException: Class "menu.language_tree_manipulator" does not existerror mentioned at the start of this comment./en/admin/config/user-interface/menu-manipulatorto see if there were any settings to change, but I got a different WSOD,ArgumentCountError: Too few arguments to function Drupal\Core\Form\ConfigFormBase::__construct(), 1 passed in /var/www/html/web/modules/contrib/menu_manipulator/src/Form/MenuManipulatorSettingsForm.php on line 88 and exactly 2 expected in Drupal\Core\Form\ConfigFormBase->__construct() (line 44 of core/lib/Drupal/Core/Form/ConfigFormBase.php).Now I'm not sure what to do next!
Can someone experiencing this problem help me to figure out how to reproduce the error on a fresh site install?
Comment #20
mparker17For people who prefer patches, I've created a patch of the current state of the merge request.
(if you want to contribute code to this issue please contribute in the merge request: I'm only providing these patches as a convenience this time, to help me answer a question in another issue — thanks for your understanding)
Comment #21
mparker17Since I have asked for someone experiencing this problem help me to figure out how to reproduce the error on a fresh site install, I'm going to change this issue's status to
Postponed (maintainer needs more info). If you can help me, please post it here, and change the Status back toActiveorNeeds work.(thanks for your understanding and patience with me as I try to manage this module's issue queue)
Comment #23
ssaranova commentedI have updated the patch using menu_manipulator module v4.0.0
Comment #24
ssaranova commentedI have uploaded the patch and interdiff files