Creating Gatsby log entry fails if resource type name has been modified

Created on 7 October 2021, over 3 years ago
Updated 22 March 2023, almost 2 years ago

Problem/Motivation

JSON Api allows for modification of details of what is rendered from the base entity information. The gatsby instant preview/ fast builds log relies on the entity type name matching for it to load related entity json

Steps to reproduce

To reproduce write a custom module, or use JSON API extras module to modify the resource type name of entity referenced by a node. Then create/ update a node which has a reference to the entity that has had its JSON API resource type name modified. If the modification no longer follows the `entity type id--bundle` format, then the log will not be written.

Proposed resolution

Don't rely purely on the output of the JSON API endpoint to load related entities, and instead load the type information from JSON API, and pull the actual entity type from that list.

Remaining tasks

I've attached a patch which I believe addresses the issue, but it needs review.

🐛 Bug report
Status

Needs work

Version

2.0

Component

Code

Created by

🇬🇧United Kingdom deranga

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

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.

Production build 0.71.5 2024