Override a non-indexed bundle on a per-entity basis

Created on 19 June 2017, over 7 years ago
Updated 3 April 2024, 10 months ago

Hello,

With the current state of the module, it is impossible to have the settings for a bundle set to "not index" and then the possibility to index per content.

I will upload a patch for that.

I currently don't have the time to make a better patch.

✨ Feature request
Status

Needs work

Version

4.0

Component

Code

Created by

πŸ‡«πŸ‡·France Grimreaper France πŸ‡«πŸ‡·

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

Merge Requests

Comments & Activities

Not all content is available!

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

  • πŸ‡ΊπŸ‡Έ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
  • πŸ‡ΊπŸ‡Έ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 method getAllowedEntities() 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.

  • Pipeline finished with Success
    27 days ago
    Total: 322s
    #385046
  • Pipeline finished with Success
    27 days ago
    Total: 412s
    #385148
  • πŸ‡ΊπŸ‡Έ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.

Production build 0.71.5 2024