Drupal 10.4.5 on PHP 8.2.27
I have a node with several Media images embedded through text paragraphs.
The node will preview fine. It works fine in the editor.
When I save the node I get:
TypeError: Drupal\entity_usage\Events\UrlToEntityEvent::setEntityInfo(): Argument #2 ($entity_id) must be of type string|int, null given, called in /WEBSITEFOLDER/web/modules/contrib/entity_usage/src/UrlToEntityIntegrations/EntityRouting.php on line 72 in Drupal\entity_usage\Events\UrlToEntityEvent->setEntityInfo() (line 75 of /WEBSITEFOLDER/web/modules/contrib/entity_usage/src/Events/UrlToEntityEvent.php).
I tried doing a batch update and got this response:
#0 /var/www/html/web/modules/contrib/entity_usage/src/UrlToEntityIntegrations/EntityRouting.php(72): Drupal\entity_usage\Events\UrlToEntityEvent->setEntityInfo('media', NULL)
#1 [internal function]: Drupal\entity_usage\UrlToEntityIntegrations\EntityRouting->getEntityFromRouting(Object(Drupal\entity_usage\Events\UrlToEntityEvent), 'entity_usage.ur...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#2 /var/www/html/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func(Array, Object(Drupal\entity_usage\Events\UrlToEntityEvent), 'entity_usage.ur...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#3 /var/www/html/web/modules/contrib/entity_usage/src/UrlToEntity.php(92): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object(Drupal\entity_usage\Events\UrlToEntityEvent), 'entity_usage.ur...')
#4 /var/www/html/web/modules/contrib/entity_usage/src/Plugin/EntityUsage/Track/HtmlLink.php(36): Drupal\entity_usage\UrlToEntity->findEntityIdByUrl('media/add/image')
#5 /var/www/html/web/modules/contrib/entity_usage/src/Plugin/EntityUsage/Track/TextFieldEmbedBase.php(26): Drupal\entity_usage\Plugin\EntityUsage\Track\HtmlLink->parseEntitiesFromText('<h2>Adding imag...')
#6 /var/www/html/web/modules/contrib/entity_usage/src/EntityUsageTrackBase.php(236): Drupal\entity_usage\Plugin\EntityUsage\Track\TextFieldEmbedBase->getTargetEntities(Object(Drupal\text\Plugin\Field\FieldType\TextLongItem))
#7 /var/www/html/web/modules/contrib/entity_usage/src/EntityUpdateManager.php(89): Drupal\entity_usage\EntityUsageTrackBase->trackOnEntityCreation(Object(Drupal\paragraphs\Entity\Paragraph))
#8 /var/www/html/web/modules/contrib/entity_usage/src/EntityUsageBatchManager.php(312): Drupal\entity_usage\EntityUpdateManager->trackUpdateOnCreation(Object(Drupal\paragraphs\Entity\Paragraph))
#9 /var/www/html/web/modules/contrib/entity_usage/src/EntityUsageBatchManager.php(240): Drupal\entity_usage\EntityUsageBatchManager::doBulkRevisionable(Object(Drupal\Core\Entity\Sql\SqlContentEntityStorage), Object(Drupal\entity_usage\EntityUsage), Object(Drupal\Core\Entity\ContentEntityType), Array)
#10 /var/www/html/web/core/includes/batch.inc(297): Drupal\entity_usage\EntityUsageBatchManager::updateSourcesBatchWorker('paragraph', false, Array)
#11 /var/www/html/web/core/includes/batch.inc(139): _batch_process()
#12 /var/www/html/web/core/includes/batch.inc(95): _batch_do()
#13 /var/www/html/web/core/modules/system/src/Controller/BatchController.php(52): _batch_page(Object(Symfony\Component\HttpFoundation\Request))
#14 [internal function]: Drupal\system\Controller\BatchController->batchPage(Object(Symfony\Component\HttpFoundation\Request))
#15 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#16 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(638): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#17 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#18 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#19 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(181): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#20 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#21 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#22 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#23 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#24 /var/www/html/web/core/modules/big_pipe/src/StackMiddleware/ContentLength.php(32): Drupal\Core\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#25 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(116): Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#26 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(90): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#27 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#28 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#29 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#30 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#31 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(741): Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#32 /var/www/html/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#33 {main}
If I remove the module the node saves and the images display as normal.
Not sure what's going on here.