- First commit to issue fork.
- Status changed to Fixed
over 1 year ago 12:21pm 11 May 2023 - Status changed to Fixed
over 1 year ago 12:30pm 11 May 2023
Some pages that fetch nodes are broken after installing and configuring the targets:
AssertionError: Cannot load the "target" entity with NULL ID. in assert() (line 295 of /var/www/html/docroot/core/lib/Drupal/Core/Entity/EntityStorageBase.php)
#0 /var/www/html/docroot/core/lib/Drupal/Core/Entity/EntityStorageBase.php(295): assert(false, 'Cannot load the...')
#1 /var/www/html/docroot/modules/contrib/targets/src/HttpKernel/PathProcessorTarget.php(129): Drupal\Core\Entity\EntityStorageBase->load(NULL)
#2 /var/www/html/docroot/core/lib/Drupal/Core/PathProcessor/PathProcessorManager.php(108): Drupal\targets\HttpKernel\PathProcessorTarget->processOutbound('/homepage', Array, Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\GeneratedUrl))
#3 /var/www/html/docroot/core/lib/Drupal/Core/Routing/UrlGenerator.php(388): Drupal\Core\PathProcessor\PathProcessorManager->processOutbound('/homepage', Array, Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\GeneratedUrl))
#4 /var/www/html/docroot/core/lib/Drupal/Core/Routing/UrlGenerator.php(297): Drupal\Core\Routing\UrlGenerator->processPath('/node/6', Array, Object(Drupal\Core\GeneratedUrl))
#5 /var/www/html/docroot/core/lib/Drupal/Core/Render/MetadataBubblingUrlGenerator.php(105): Drupal\Core\Routing\UrlGenerator->generateFromRoute('entity.node.can...', Array, Array, true)
#6 /var/www/html/docroot/core/lib/Drupal/Core/Url.php(763): Drupal\Core\Render\MetadataBubblingUrlGenerator->generateFromRoute('entity.node.can...', Array, Array, true)
#7 /var/www/html/docroot/core/lib/Drupal/Core/Utility/LinkGenerator.php(182): Drupal\Core\Url->toString(true)
#8 /var/www/html/docroot/core/lib/Drupal/Core/Render/Element/Link.php(95): Drupal\Core\Utility\LinkGenerator->generate(Object(Drupal\Core\Render\Markup), Object(Drupal\Core\Url))
#9 [internal function]: Drupal\Core\Render\Element\Link::preRenderLink(Array)
#10 /var/www/html/docroot/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(101): call_user_func_array(Array, Array)
#11 /var/www/html/docroot/core/lib/Drupal/Core/Render/Renderer.php(772): Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_ren...', 'exception', 'Drupal\\Core\\Ren...')
This was triggered when it tried to create the following path: node/6/delete
The variable $node_target_id (124 on PathProcessorTarget.php) doesn't get set and causes it to fail down the line.
Create a new install with content and install and configure the targets and go to an existing node page.
Multiple solutions are possible i think:
Current workaround was resaving all nodes in the content overview after commenting out the code that break it.
Fixed
1.1
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.