Call to a member function getClass() on null entity share module error

Created on 10 June 2022, over 2 years ago
Updated 18 January 2023, almost 2 years ago

Error: Call to a member function getClass() on null in Drupal\jsonapi\Normalizer\FieldItemNormalizer->denormalize() (line 130 of /var/www/html/core/modules/jsonapi/src/Normalizer/FieldItemNormalizer.php)
#0 /var/www/html/vendor/symfony/serializer/Serializer.php(182): Drupal\jsonapi\Normalizer\FieldItemNormalizer->denormalize()
#1 /var/www/html/core/modules/jsonapi/src/Serializer/Serializer.php(75): Symfony\Component\Serializer\Serializer->denormalize()
#2 /var/www/html/core/modules/jsonapi/src/Normalizer/FieldNormalizer.php(65): Drupal\jsonapi\Serializer\Serializer->denormalize()
#3 /var/www/html/vendor/symfony/serializer/Serializer.php(182): Drupal\jsonapi\Normalizer\FieldNormalizer->denormalize()
#4 /var/www/html/core/modules/jsonapi/src/Serializer/Serializer.php(75): Symfony\Component\Serializer\Serializer->denormalize()
#5 /var/www/html/core/modules/jsonapi/src/Normalizer/ContentEntityDenormalizer.php(85): Drupal\jsonapi\Serializer\Serializer->denormalize()
#6 /var/www/html/core/modules/jsonapi/src/Normalizer/EntityDenormalizerBase.php(99): Drupal\jsonapi\Normalizer\ContentEntityDenormalizer->prepareInput()
#7 /var/www/html/vendor/symfony/serializer/Serializer.php(182): Drupal\jsonapi\Normalizer\EntityDenormalizerBase->denormalize()
#8 /var/www/html/core/modules/jsonapi/src/Serializer/Serializer.php(75): Symfony\Component\Serializer\Serializer->denormalize()
#9 /var/www/html/core/modules/jsonapi/src/Normalizer/JsonApiDocumentTopLevelNormalizer.php(167): Drupal\jsonapi\Serializer\Serializer->denormalize()
#10 /var/www/html/modules/contrib/entity_share/modules/entity_share_client/src/Service/JsonapiHelper.php(287): Drupal\jsonapi\Normalizer\JsonApiDocumentTopLevelNormalizer->denormalize()
#11 /var/www/html/modules/contrib/entity_share/modules/entity_share_client/src/Service/JsonapiHelper.php(467): Drupal\entity_share_client\Service\JsonapiHelper->extractEntity()
#12 /var/www/html/modules/contrib/entity_share/modules/entity_share_async/src/Plugin/QueueWorker/EntityShareAsyncWorker.php(144): Drupal\entity_share_client\Service\JsonapiHelper->importEntityListData()
#13 /var/www/html/core/lib/Drupal/Core/Cron.php(180): Drupal\entity_share_async\Plugin\QueueWorker\EntityShareAsyncWorker->processItem()
#14 /var/www/html/modules/contrib/ultimate_cron/src/UltimateCron.php(69): Drupal\Core\Cron->processQueues()
#15 /var/www/html/modules/contrib/ultimate_cron/src/ProxyClass/UltimateCron.php(70): Drupal\ultimate_cron\UltimateCron->run()
#16 /var/www/html/core/modules/automated_cron/src/EventSubscriber/AutomatedCron.php(65): Drupal\ultimate_cron\ProxyClass\UltimateCron->run()
#17 [internal function]: Drupal\automated_cron\EventSubscriber\AutomatedCron->onTerminate()
#18 /var/www/html/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func()
#19 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(88): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
#20 /var/www/html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(32): Symfony\Component\HttpKernel\HttpKernel->terminate()
#21 /var/www/html/core/lib/Drupal/Core/DrupalKernel.php(686): Stack\StackedHttpKernel->terminate()
#22 /var/www/html/index.php(27): Drupal\Core\DrupalKernel->terminate()
#23 {main}

Module:entity_share
Drupal:8.9

🐛 Bug report
Status

Needs work

Version

3.0

Component

Code

Created by

🇮🇳India hazra.bhaskar

Live updates comments and jobs are added and updated live.
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.

  • Assigned to Grimreaper
  • Status changed to Active almost 2 years ago
  • 🇫🇷France Grimreaper France 🇫🇷
  • Issue was unassigned.
  • Status changed to Closed: cannot reproduce almost 2 years ago
  • 🇫🇷France Grimreaper France 🇫🇷

    Hi,

    I have tested with:
    - a node with Metatag with and without values,
    - with and without the Metatag field enhancer enabled on the server website.

    Also, there seems to be a bug in JSON API Extras, you have to save a resource override twice to have configuration saved and do not forget to clear cache after applying the field enhancer.

    Everytime I have been able to import the entity, with or without the meatags depending if the field enhancer was enabled on the server website, but no fatal error.

    Like @gayatri chahar had written. This needs clear steps from a frest install to reproduce.

  • 🇺🇸United States bwoods

    I just ran into this issue after using Entity Share for a couple of months without any issues. It turns out the problem was that I removed a field that's part of an unrelated contrib module from the content type on the Server. Even though that field was not being used, it was creating a record in the field table (previously, since the field was left blank, it wasn't creating any records). JSON:API was picking up this record as part of the node, and because it's a special field, it could not process. To fix this, I had to re-enable the field on the form display screen, edit the node to leave the field blank, and that deleted the record in the field table. By doing this, Entity Share began working again. This seemed rather bizarre, but hopefully this troubleshooting will help someone else!

Production build 0.71.5 2024