Store entity instance settings as fields on entity

Created on 19 February 2019, almost 6 years ago
Updated 20 September 2024, 2 months ago

Problem/Motivation

Currently per-entity overrides are saved in the simple_sitemap_entity_overrides table. Overrides here can't be used with the entities as one expects.

Proposed resolution

Save the overrides in a field which can be part of the main entity.

Remaining tasks

  • - Use separate field to keep it clean for extension like views (as requested in #2941322: Expose entity sitemap settings in views ).
  • Persist to show bundle level settings by default. - It persist on widget settings, but still need to figure out why it doesn't carry to entity page.
  • Add field automatically when enable from entity_type form (i.e. no_ui=TRUE in @FieldType())
  • Migrate existing data from
  • Clean up FormHelper and form_alter.
  • Make sure the solution works for non-bundle entities as well.
  • Remove the field from the entity type in Simplesitemap::disableEntityType() as well as on module uninstall
  • Fix the widget from your patch to closer resemble the original (javascript, decimal priority, ...)
  • Make sure Simplesitemap::setEntityInstanceSettings(), Simplesitemap::getEntityInstanceSettings() and Simplesitemap::removeEntityInstanceSettings() are functioning correctly.

Completed tasks

  • Use separate field to keep it clean for extension like views (as requested in #2941322: Expose entity sitemap settings in views ).
  • Persist to show bundle level settings by default. - It persists on widget settings, but still, need to figure out why it doesn't carry to entity page.
  • Add field automatically when enabling from entity_type form (i.e. no_ui=TRUE in @FieldType()) - Turns out we might not need this as it would introduce additional complexity. Keeping it as a regular field means, it could be added to any content entity. just like comment field.
  • Make sure the solution works for non-bundle entities as well. - Tested with the user entity (attached) and seems it works!

User interface changes

TBC

API changes

TBC

Data model changes

Yes, the data in the simple_sitemap_entity_overrides table need to be migrated.

Release notes snippet

Feature request
Status

Active

Version

4.0

Component

Code

Created by

🇬🇧United Kingdom vijaycs85 London, UK

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.

  • 🇯🇵Japan ilfelice

    Howdy,

    Thank you for a great module!

    I have a quick question: am I) right to assume that this feature would allow exposing sitemap settings in views?

  • Status changed to Active 2 months ago
  • 🇩🇪Germany gbyte Berlin

    am I) right to assume that this feature would allow exposing sitemap settings in views?

    If this were in, we possibly might need an additional views hook but that would be very easy to implement. So yes.

  • 🇯🇵Japan ilfelice

    @gbyte

    Thank you for the response.

    I can see how using views would allow monitoring sitemap settings, and also using ECA to automate inclusion/exclusion in the sitemap upon publishing/unpublishing.

    Not a developer, but I am available for testing, so let me know if there is anything I can do to get this going.

Production build 0.71.5 2024