This could be related to #3025037: Make JSON:API Extras compatible with the upcoming 2.1 release and I might be reporting to soon..

I just update to jsonapi 2.1.0 and jsonapi_extras 3.3.0

Now I get

TypeError: Argument 3 passed to Drupal\jsonapi\JsonApiResource\JsonApiDocumentTopLevel::__construct() must be an instance of Drupal\jsonapi\JsonApiResource\LinkCollection, array given, called in /app/web/modules/contrib/jsonapi_extras/src/EntityToJsonApi.php on line 124 in Drupal\jsonapi\JsonApiResource\JsonApiDocumentTopLevel->__construct() (line 58 of modules/contrib/jsonapi/src/JsonApiResource/JsonApiDocumentTopLevel.php).

I'm attaching a trivial patch.

CommentFileSizeAuthor
jsonapi_extras-doctoplevel_arg3.patch1.64 KBmiiimooo

Comments

miiimooo created an issue. See original summary.

logickal’s picture

I found this issue as well, and implemented the same fix over in my patch for #3028493: EntityToJsonApi includes do not honor overridden fields

giorgosk’s picture

Happened to me with contentacms which includes
jsonapi 2.1.0 and jsonapi_extras 3.3.0 under the hood

The error appears after adding a node which uses the existing link field and the above error message appears after pressing save button (save node) right when its about to view the node

applying patch works and the node/XXX can be viewed properly without any error

e0ipso’s picture

Status: Active » Needs review

Let's kick off testing.

Status: Needs review » Needs work

The last submitted patch, jsonapi_extras-doctoplevel_arg3.patch, failed testing. View results

wim leers’s picture

Issue tags: +API-First Initiative

The patch fixes the reported bug.

But HEAD has another failure:

The URI 'http://:/' is malformed

That does look malformed.

@e0ipso: up to you if you want to commit this first and fix that in a separate issue.

e0ipso’s picture

Status: Needs work » Fixed

Let's commit this, the failures are unrelated.

  • e0ipso committed f1cca6d on 8.x-3.x authored by miiimooo
    Issue #3027768 by miiimooo, e0ipso, logickal, GiorgosK, Wim Leers:...
dustinleblanc’s picture

Confirming this fixed for me too!

Status: Fixed » Closed (fixed)

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