az-digital / az_quickstart

UArizona's web content management system built with Drupal 10.
https://quickstart.arizona.edu
GNU General Public License v2.0
30 stars 20 forks source link

News export error when cardinality of news image field is changed #3236

Open trackleft opened 8 months ago

trackleft commented 8 months ago

On the news site, I am attempting to navigate to /az_quickstart/export/az_news/v1/az_news.json But I get a Fatal error screen WSOD

In the log I see.

TypeError: Illegal offset type in Drupal\Core\Entity\EntityStorageBase->load() (line 263 of /app/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php).

And This call stack

#0 /app/web/profiles/custom/az_quickstart/modules/custom/az_news/az_news_export/src/Plugin/views/row/AZNewsDataFieldRow.php(64): Drupal\Core\Entity\EntityStorageBase->load(Array)
#1 /app/web/profiles/custom/az_quickstart/modules/custom/az_news/az_news_export/src/Plugin/views/row/AZNewsDataFieldRow.php(190): Drupal\az_news_export\Plugin\views\row\AZNewsDataFieldRow->Drupal\az_news_export\Plugin\views\row\{closure}(Array, Object(Drupal\node\Entity\Node))
#2 /app/web/core/modules/rest/src/Plugin/views/style/Serializer.php(130): Drupal\az_news_export\Plugin\views\row\AZNewsDataFieldRow->render(Object(Drupal\views\ResultRow))
#3 /app/web/core/modules/rest/src/Plugin/views/display/RestExport.php(433): Drupal\rest\Plugin\views\style\Serializer->render()
#4 /app/web/core/lib/Drupal/Core/Render/Renderer.php(627): Drupal\rest\Plugin\views\display\RestExport->Drupal\rest\Plugin\views\display\{closure}()
#5 /app/web/core/modules/rest/src/Plugin/views/display/RestExport.php(434): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#6 /app/web/core/modules/views/src/ViewExecutable.php(1548): Drupal\rest\Plugin\views\display\RestExport->render()
#7 /app/web/core/modules/rest/src/Plugin/views/display/RestExport.php(424): Drupal\views\ViewExecutable->render()
#8 /app/web/core/modules/views/src/ViewExecutable.php(1645): Drupal\rest\Plugin\views\display\RestExport->execute()
#9 /app/web/core/modules/views/src/Element/View.php(81): Drupal\views\ViewExecutable->executeDisplay('rest_export_1', Array)
#10 [internal function]: Drupal\views\Element\View::preRenderViewElement(Array)
#11 /app/web/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(111): call_user_func_array(Array, Array)
#12 /app/web/core/lib/Drupal/Core/Render/Renderer.php(858): Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_ren...', 'exception', 'Drupal\\Core\\Ren...')
#13 /app/web/core/lib/Drupal/Core/Render/Renderer.php(421): Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array)
#14 /app/web/core/lib/Drupal/Core/Render/Renderer.php(240): Drupal\Core\Render\Renderer->doRender(Array, true)
#15 /app/web/core/lib/Drupal/Core/Render/Renderer.php(153): Drupal\Core\Render\Renderer->render(Array, true)
#16 /app/web/core/lib/Drupal/Core/Render/Renderer.php(627): Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}()
#17 /app/web/core/lib/Drupal/Core/Render/Renderer.php(154): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#18 /app/web/core/modules/rest/src/Plugin/views/display/RestExport.php(407): Drupal\Core\Render\Renderer->renderRoot(Array)
#19 /app/web/core/modules/views/src/Routing/ViewPageController.php(56): Drupal\rest\Plugin\views\display\RestExport::buildResponse('az_news_export', 'rest_export_1', Array)
#20 [internal function]: Drupal\views\Routing\ViewPageController->handle('az_news_export', 'rest_export_1', Object(Drupal\Core\Routing\RouteMatch))
#21 /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#22 /app/web/core/lib/Drupal/Core/Render/Renderer.php(627): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#23 /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#24 /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#25 /app/vendor/symfony/http-kernel/HttpKernel.php(181): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#26 /app/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#27 /app/web/core/lib/Drupal/Core/StackMiddleware/Session.php(58): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#28 /app/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#29 /app/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#30 /app/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#31 /app/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#32 /app/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#33 /app/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#34 /app/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#35 /app/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#36 /app/web/core/lib/Drupal/Core/DrupalKernel.php(704): Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#37 /app/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#38 {main}
joeparsons commented 7 months ago

Additional context: The cardinality of the image field on the news content type had been changed on the affected site.

We may also want to consider changing the cardinality of that field in the az_news module.