- Issue created by @Ankush_03
- Assigned to jaykainthola
- 🇺🇸United States brianperry
I have been digging in to this one a bit. I was able to duplicate this issue when previewing a node while editing.
The problem looks to be related to how JSON:API's IncludeResolver resolves includes. It doesn't have any concept of preview mode while doing this, so it will always resolve the revision specified by the paragraph field, which will be different from what is stored in the node edit form's form state since the revision hasn't been saved beyond the temp store yet.
Interestingly enough, JSON:API Node Preview had a similar issue reported: https://www.drupal.org/project/jsonapi_node_preview/issues/3268796 →
It was closed, but they do have code that overrides the IncludeResolver to use the already loaded form fields if they exist https://git.drupalcode.org/project/jsonapi_node_preview/-/blob/1.0.x/src... I think the solution needed here would be similar.My guess is that this issue could apply to any referenced entities, not just paragraphs.
- Assigned to brianperry