- Issue created by @matthieuscarset
- Merge request !24Resolve #3445396 "Compatibility with domain_menus" → (Open) created by matthieuscarset
- Issue was unassigned.
- Status changed to Needs review
11 months ago 8:13am 6 May 2024 Test failing because of an unrelated issue I think (e.g.
SitemapBookTest
).Unassigning this issue from me.
Ready for review.
- 🇨🇦Canada mparker17 UTC-4
@matthieuscarset, thank you for the contribution!
I think that the test (and some, but not all of the lints) is failing because the
domain_menus
module is not present in the test environment, so it cannot resolve the\Drupal\domain_menus\DomainMenusConstants
import in theDomainMenuSitemapDeriver
.There are two ways that we could proceed:
- We could modify
sitemap.info.yml
to includedomain_menus
as one of thetest_dependencies
as part of this patch.
If we go this route, we will also need to write automated tests. - We could create a new patch to the
domain_menus
module, and implement the Sitemap plugin there.
This may sound like a lot of work, but I believe it would mostly consist of opening a new issue, creating a new issue fork, copying the plugin you wrote here and modifying thenamespace
lines, and updatingdomain_menus.info.yml
This is possible because the Sitemap module uses Drupal's Plugin API → , which allows plugins for one module (e.g.: Sitemap plugins) to exist inside another module (e.g.: domain menus). The Plugin code is only run if both modules are installed. I can't think of a module that defines a Sitemap plugin at the moment, but, for example, Drupal core's Field module allows plugins of type Field to be created, and the contrib Address module → defines its own Field plugin to for a [post] address field.
As a Sitemap module maintainer, I would prefer the second option (i.e.: patch
domain_menus
), because the Sitemap module maintainers' current policy is only to maintain Sitemap plugins for Drupal core (e.g.: front page (system module), book, menu, taxonomy, etc.), and let other module maintainers use the Plugin API to add Sitemap plugins in their own module. (this policy exists because the Sitemap module maintainers are all volunteers, and we don't have very much time to maintain this module if other modules change).That being said...
- If you would like some help writing a patch to the
domain_menus
module, I would be happy to be a mentor! - If the
domain_menus
module maintainer — @drpldrp — is unwilling to accept a Sitemap plugin, and you are willing to become a Sitemap module maintainer, then I would be open to revisiting our policy to only maintain Sitemap plugins for Drupal core.
@matthieuscarset, what do you think?
- We could modify
Thank you for your reply @mparker17
I agree it would be better to have this plugin in Domain Menus. I originally proposed this plugin there indeed (see referenced issue) but it was "rejected".
I could publish a new module specifically for this sitemap plugin but if you offer, i am happy to maintain the plugin here.
Let me know what you prefer.
- 🇨🇦Canada mparker17 UTC-4
Hmm... let me think about it.
In the meantime, I've pushed some code linting fixes, but tests are still failing, because I think
composer.json
is taking precedence oversitemap.info.yml
.Once I get it working, would you be willing to write a test for the new functionality?
- Status changed to Needs work
11 months ago 7:59am 7 May 2024 Yes of course. Thank you for your help.
Let me know when/how I can help to take this plugin further.
- 🇨🇦Canada mparker17 UTC-4
mparker17 → changed the visibility of the branch 3445396-compatibility-with-domain to hidden.
- 🇨🇦Canada mparker17 UTC-4
mparker17 → changed the visibility of the branch 3445396-compatibility-with-domain to hidden.
- 🇨🇦Canada mparker17 UTC-4
A follow-up! Thank you for your patience with me!
As part of 📌 Drupal 11 compatibility fixes for sitemap Fixed , I had to move the book-related functionality into a new
<code>modules/sitemap_book/
submodule (although I couldn't figure out how to move the config schema, so I created ✨ Split sitemap_book config schema from sitemap schema Active to handle that).(I had to do this because the book module became a contrib module → and was deleted from core → )
I think that gives us a pattern that we can reuse to add support for the Domain Menus for Domains module → !
I have hidden the (old) branch associated with this issue (i.e.: based on old sitemap module code).
@matthieuscarset, may I trouble you to create a new branch for this issue (i.e.: based on newer sitemap module code), and put the code to support the domain_menus module into a
modules/sitemap_domain_menus/
, and add some tests? Once the changes are ready to merge, if you are still willing, then I will make you a maintainer of sitemap.