- πΊπΈUnited States chucksimply
Any updates here? Allowing individual entities to be indexed even if the bundle is excluded is quite a common need. Seems like the latest patch breaks module functionality.
- Status changed to Needs review
28 days ago 7:52pm 2 January 2025 - πΊπΈUnited States agentrickard Georgia (US)
Here's a version of the patch against 4.x. It does the following:
* Removes the form alter that disables per-entity overrides.
* Adds a methodgetAllowedEntities()
to the EntityManager service
* Call that method from the EntityUrlGenerator in cases where the bundle is not auto-indexed.Based on my reading of the code, access checking is handled by EntityUrlGeneratorBase, so that is omitted.
This likely needs a test, though is seems to work in my use-case.
If you would prefer an MR, I can make one.
- Merge request !119Allow indexing of individual entities based on override status. β (Open) created by agentrickard
- πΊπΈUnited States agentrickard Georgia (US)
I added an MR -- https://git.drupalcode.org/project/simple_sitemap/-/merge_requests/119 -- and updated tests.
Something is a bit off in the test. I can't seem to get the sitemap to re-render. See this part of the test code:
// Test sitemap result -- Not working as expected. # $this->generator->rebuildQueue(); # $this->generator->generate(QueueWorker::GENERATE_TYPE_BACKEND); # $this->drupalGet($this->defaultSitemapUrl); # $this->assertSession()->responseContains('node/' . $new_node1->id()); # $this->assertSession()->responseNotContains('node/' . $new_node2->id());
This returns a 404 instead of the sitemap. I assume that I missed a step somewhere.