#config dependency

โšก๏ธ Live updates comments, jobs, and issues, tagged with #config dependency will update issues and activities on this page.

Issues

The last 100 updated issues.

Activities

The last 7 days of comments and CI jobs.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia virag.jain

    Update on the issue:

    An initial attempt was made to fix this by implementing \Drupal\jsonapi_extras\Entity\JsonapiResourceConfig::onDependencyRemoval(), as pointed out by @Wim Leers, with the goal of cleaning up deleted fields from the resourceFields array. However, it turned out that the method onDependencyRemoval() wasnโ€™t being triggered at all when a field was removed.

    Upon further investigation, it appears the root cause is that \Drupal\jsonapi_extras\Entity\JsonapiResourceConfig::calculateDependencies() only adds the only adds the bundle (e.g. node.type.*) as a dependency; it doesnโ€™t include individual field configs like field.storage.node.field_foo. Without those dependencies, the entity system doesnโ€™t invoke onDependencyRemoval() when fields are deleted.

    Proposed solution:

    The plan is to update calculateDependencies() to explicitly add each field listed in resourceFields as a dependency (e.g., field.storage.node.field_foo). With that in place, onDependencyRemoval() will be properly triggered when a field is deleted.

    Inside onDependencyRemoval(), any removed fields will be automatically cleaned out of the override config. This prevents stale field entries from lingering in the YAML and eliminates the need for manual cleanup.

    Just wanted to check in and see if this approach makes sense before finalising the patch. Let me know your thoughts!

Production build 0.71.5 2024