Problem/Motivation

Adding or removing fields to an entity type buyndle, i.e. node--content type does not update jsonapi_extras.jsonapi_resource_config.{type}--{bundle}.yml config.

Steps to reproduce

1) Set "Disable by default" in JSON:API extras config
2) Set "Validate config integrity" in JSON:API extras config
3) Configure a node bundle to be enabled
4) Add a field to the node bundle
5) Export config

When attempting to re-import config you should get the following config sync error:
" There were errors validating the config synchronization. Integrity check failed for the JSON:API Extras configuration. There is no configuration set for the field "field_name" on the resource "node--{bundle}". To fix this, disable the configuration integrity check (in the JSON:API Extras settings page), so you can import these fields locally. After that configure and re-save this resource type in the JSON:API Extras configuration page . Finally, re-enable the configuration integrity checks and export the configuration again."

jsonapi_extras.jsonapi_resource_config.{type}--{bundle} has a config dependency set on the entity type bundle, but does not update when that bundle changes, unless you manually save the config.

Proposed resolution

When fields are modified on the entity type bundle, jsonapi_extras.jsonapi_resource_config.{type}--{bundle} should update as well.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

adam-delaney created an issue. See original summary.

adam-delaney’s picture

joachim’s picture

Priority: Normal » Major

It's related to that issue, not sure it's exactly the same fix.

I think this is a major -- it causes a crash when you import config if you didn't remember to update the resource config to get the new field.

benstallings made their first commit to this issue’s fork.

benstallings’s picture

Status: Active » Needs review

bbrala made their first commit to this issue’s fork.

bbrala’s picture

Status: Needs review » Fixed

Also closes #3031524: JSON:API Extras field config sticks when field is removed. Merging this into main. Will release a beta soon. Thanks everyone, als in the other issue ;)

Ai was used to assist in development.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.