When trying to sync a taxonomy, the "changed" date comes in as a timestamp which causes an error when converting using DateTime::createFromFormat:

ResponseText: Error: Call to a member function getTimestamp() on boolean in Drupal\entity_share_client\Service\JsonapiHelper->importEntityListData() (line 411 of /app/web/modules/contrib/entity_share/modules/entity_share_client/src/Service/JsonapiHelper.php).

entity_share version 8.x-2.x-dev
jsonapi version 8.x-2.0-rc1

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

natanmoraes created an issue. See original summary.

natanmoraes’s picture

natanmoraes’s picture

Rerolled the patch after having the one from this issue (I need both applied): https://www.drupal.org/project/entity_share/issues/3004186

Grimreaper’s picture

Status: Needs review » Postponed
Related issues: +#2939827: Provide a supported API for entity denormalization

Hello,

Sorry for the delay and thank you for the patch.

The branch 8.x-2.x is highly unstable. And the priority issue is #2939827: Provide a supported API for entity denormalization.

Postponing this issue until the other one is done.

Grimreaper’s picture

Status: Postponed » Postponed (maintainer needs more info)

Hello,

Do you still have the problem on Drupal 8.7.1 and entity share 8.x-2.0-alpha1?

I have make a basic test with taxonomy terms it works for me.

Grimreaper’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Closing the issue. If there is still the problem, please re-open with details in the comment.

mr.baileys’s picture

Issue tags: +Needs tests
FileSize
826 bytes

Tentatively re-opening, as I'm having the same issue although not with taxonomy terms. Drupal 8.7.6, Entity Share 8.x-2.0-alpha2:

Error: Call to a member function getTimestamp() on boolean in Drupal\entity_share_client\Service\JsonapiHelper->getStatusInfo() (line 725 of /var/www/html/web/modules/contrib/entity_share/modules/entity_share_client/src/Service/JsonapiHelper.php).

Entity Share Client is trying to convert the entity changed date from RFC3339 to a unix timestamp. However, the changed data passed by JSON:API already *is* a unix timestamp, so the conversion fails. I'm not sure why this line was added in #3044732: Compatibility with JSONAPI 2.x / Core 8.7.x?

$changed_datetime = \DateTime::createFromFormat(\DateTime::RFC3339, $data['attributes']['changed']);
Grimreaper’s picture

@mr.baileys: please continue discussion in #3059358: Error after selection of a channel I think it is the same issue.