- Issue created by @aron novak
- @aron-novak opened merge request.
- Status changed to Needs review
about 2 years ago 8:54am 23 January 2023
Cannot load the "node" entity with NULL ID.
#1 /var/www/html/web/core/lib/Drupal/Core/Entity/EntityBase.php(488): Drupal\Core\Entity\EntityStorageBase->load(NULL)
#2 /var/www/html/web/modules/contrib/token/token.tokens.inc(1229): Drupal\Core\Entity\EntityBase::load(NULL)
#3 [internal function]: book_tokens('node', Array, Array, Array, Object(Drupal\Core\Render\BubbleableMetadata))
#4 /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(426): call_user_func_array(Object(Closure), Array)
#5 /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(405): Drupal\Core\Extension\ModuleHandler->Drupal\Core\Extension\{closure}(Object(Closure), 'book')
#6 /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(433): Drupal\Core\Extension\ModuleHandler->invokeAllWith('tokens', Object(Closure))
#7 /var/www/html/web/core/lib/Drupal/Core/Utility/Token.php(357): Drupal\Core\Extension\ModuleHandler->invokeAll('tokens', Array)
#8 /var/www/html/web/core/lib/Drupal/Core/Utility/Token.php(239): Drupal\Core\Utility\Token->generate('node', Array, Array, Array, Object(Drupal\Core\Render\BubbleableMetadata))
#9 /var/www/html/web/core/lib/Drupal/Core/Utility/Token.php(189): Drupal\Core\Utility\Token->doReplace(true, '[node:book:titl...', Array, Array, Object(Drupal\Core\Render\BubbleableMetadata))
#10 /var/www/html/web/modules/contrib/auto_entitylabel/src/AutoEntityLabelManager.php(299): Drupal\Core\Utility\Token->replace(Object(Drupal\Core\StringTranslation\TranslatableMarkup), Array, Array, Object(Drupal\Core\Render\BubbleableMetadata))
Upon creation of books with migrate (or in another programmatic way), it might happen that the book information is incomplete.
Token module should not fail on such data, but move on and do not generate tokens.
Needs review
1.0
Code