ID is not assigned to newly saved external entities

Created on 20 September 2024, 2 months ago

When saving a new external entity, the ID is not assigned to the external entity object. Following warnings can be found in the logs:

Warning: Undefined variable $raw_data in Drupal\external_entities\ExternalEntityStorage->doSaveFieldItems() (line 438 of /app/web/modules/contrib/external_entities/src/ExternalEntityStorage.php) #0 /app/web/core/includes/bootstrap.inc(164): _drupal_error_handler_real()
#1 /app/web/modules/contrib/external_entities/src/ExternalEntityStorage.php(438): _drupal_error_handler()
#2 /app/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(720): Drupal\external_entities\ExternalEntityStorage->doSaveFieldItems()
#3 /app/web/modules/contrib/external_entities/src/ExternalEntityStorage.php(327): Drupal\Core\Entity\ContentEntityStorageBase->doSave()
#4 /app/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(486): Drupal\external_entities\ExternalEntityStorage->doSave()
#5 /app/web/core/lib/Drupal/Core/Entity/EntityBase.php(354): Drupal\Core\Entity\EntityStorageBase->save()
#6 /app/web/modules/custom/wpbo_fgwp_asset/src/Form/AssetForm.php(159): Drupal\Core\Entity\EntityBase->save()
#7 [internal function]: Drupal\wpbo_fgwp_asset\Form\AssetForm->save()
#8 /app/web/core/lib/Drupal/Core/Form/FormSubmitter.php(129): call_user_func_array()
#9 /app/web/core/lib/Drupal/Core/Form/FormSubmitter.php(67): Drupal\Core\Form\FormSubmitter->executeSubmitHandlers()
#10 /app/web/core/lib/Drupal/Core/Form/FormBuilder.php(606): Drupal\Core\Form\FormSubmitter->doSubmitForm()
#11 /app/web/core/lib/Drupal/Core/Form/FormBuilder.php(325): Drupal\Core\Form\FormBuilder->processForm()
#12 /app/web/modules/custom/entity_confirmation/src/HtmlEntityFormController.php(83): Drupal\Core\Form\FormBuilder->buildForm()
#13 [internal function]: Drupal\entity_confirmation\HtmlEntityFormController->getContentResult()
#14 /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#15 /app/web/core/lib/Drupal/Core/Render/Renderer.php(627): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\@closure()
#16 /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext()
#17 /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#18 /app/vendor/symfony/http-kernel/HttpKernel.php(181): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\@closure()
#19 /app/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#20 /app/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
#21 /app/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#22 /app/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#23 /app/web/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle()
#24 /app/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\big_pipe\StackMiddleware\ContentLength->handle()
#25 /app/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#26 /app/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#27 /app/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle()
#28 /app/web/core/lib/Drupal/Core/DrupalKernel.php(704): Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
#29 /app/web/index.php(19): Drupal\Core\DrupalKernel->handle()
#30 @main.
Warning: Trying to access array offset on value of type null in Drupal\external_entities\ExternalEntityStorage->doSaveFieldItems() (line 438 of /app/web/modules/contrib/external_entities/src/ExternalEntityStorage.php) #0 /app/web/core/includes/bootstrap.inc(164): _drupal_error_handler_real()
#1 /app/web/modules/contrib/external_entities/src/ExternalEntityStorage.php(438): _drupal_error_handler()
#2 /app/web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php(720): Drupal\external_entities\ExternalEntityStorage->doSaveFieldItems()
#3 /app/web/modules/contrib/external_entities/src/ExternalEntityStorage.php(327): Drupal\Core\Entity\ContentEntityStorageBase->doSave()
#4 /app/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(486): Drupal\external_entities\ExternalEntityStorage->doSave()
#5 /app/web/core/lib/Drupal/Core/Entity/EntityBase.php(354): Drupal\Core\Entity\EntityStorageBase->save()
#6 /app/web/modules/custom/wpbo_fgwp_asset/src/Form/AssetForm.php(159): Drupal\Core\Entity\EntityBase->save()
#7 [internal function]: Drupal\wpbo_fgwp_asset\Form\AssetForm->save()
#8 /app/web/core/lib/Drupal/Core/Form/FormSubmitter.php(129): call_user_func_array()
#9 /app/web/core/lib/Drupal/Core/Form/FormSubmitter.php(67): Drupal\Core\Form\FormSubmitter->executeSubmitHandlers()
#10 /app/web/core/lib/Drupal/Core/Form/FormBuilder.php(606): Drupal\Core\Form\FormSubmitter->doSubmitForm()
#11 /app/web/core/lib/Drupal/Core/Form/FormBuilder.php(325): Drupal\Core\Form\FormBuilder->processForm()
#12 /app/web/modules/custom/entity_confirmation/src/HtmlEntityFormController.php(83): Drupal\Core\Form\FormBuilder->buildForm()
#13 [internal function]: Drupal\entity_confirmation\HtmlEntityFormController->getContentResult()
#14 /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array()
#15 /app/web/core/lib/Drupal/Core/Render/Renderer.php(627): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\@closure()
#16 /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext()
#17 /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
#18 /app/vendor/symfony/http-kernel/HttpKernel.php(181): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\@closure()
#19 /app/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#20 /app/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle()
#21 /app/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#22 /app/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#23 /app/web/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle()
#24 /app/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\big_pipe\StackMiddleware\ContentLength->handle()
#25 /app/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#26 /app/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#27 /app/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle()
#28 /app/web/core/lib/Drupal/Core/DrupalKernel.php(704): Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
#29 /app/web/index.php(19): Drupal\Core\DrupalKernel->handle()
#30 @main.
🐛 Bug report
Status

Needs review

Version

3.0

Component

Code

Created by

🇧🇪Belgium rp7

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024