Problem/Motivation

Using this module with ContentaCMS and Contenta_vue_nuxt consumer, on a fresh install, request :
api/recipes?include=image,image.thumbnail&fields[images]=thumbnail

Raise:

Error: Call to a member function getIncludes() on null in Drupal\jsonapi\Normalizer\EntityNormalizer->normalize() (line 107 of modules/contrib/jsonapi/src/Normalizer/EntityNormalizer.php).

Proposed resolution

Add a test for $normalized_field before calling getIncludes().

Remaining tasks

Reviews needed

User interface changes

None

API changes

None

Data model changes

None

CommentFileSizeAuthor
#2 getIncludes-on-null-error-3011836-2.patch1009 bytesmogtofu33

Comments

mogtofu33 created an issue. See original summary.

mogtofu33’s picture

StatusFileSize
new1009 bytes
gabesullice’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: +API-First Initiative

Hi @mogtofu33!

Thanks for the bug report!

Unfortunately, JSON API v1 is in critical support only. Are you able to upgrade to JSON API 2.x? I would highly encourage it if so!

This particular bit of code doesn't even exist any longer :)

mogtofu33’s picture

Hi,

It's just because for now contenta_jsonapi is still using 1.23, but will probably update soon.

I posted this patch mostly to be able to open this PR for contenta_jsonapi.

I completely understand the freeze of 1.x, this issue is just an informative placeholder until contenta_jsonapi is on 2.x.

Regards.

gabesullice’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

@mogtofu33, perfect. Thank you again!

wim leers’s picture

Crediting @gabesullice. @mogtofu33 is already credited :)