Open blairlearn opened 1 month ago
The error appears to be due to the lack of a "guard" if
for the call to getTranslationFromContext
for the scenario where a blog post has no series.
This is a lack of error checking, but the upstream error is caused by #4341.
Issue description
The "Regenerate URLs" is unable to run to completion, stalling out midway through the process. Looking into the error logs, this appears to be due to a PHP error.
Steps to reproduce the issue
NOTE: This may requires a copy of an ACSF database.
site_admin
role.Configuration
>Search and metadata
>Regenerate Urls
.Media
andContent
.Update the URL alias for paths having an old URL alias
. (ChoosingRegenerate URL aliases for all paths
will also work, but is likely to take longer.)Update
.What's the expected result?
What's the actual result?
The watchdog log will contain a message similar to
https://www-cms-test.cancer.gov|1714750770|php|23.52.15.43|https://www-cms-test.cancer.gov/batch?_format=json&id=2791&op=do|https://www-cms-test.cancer.gov/batch?id=2791&op=start|46||TypeError: Drupal\Core\Entity\EntityRepository::getTranslationFromContext(): Argument #1 ($entity) must be of type Drupal\Core\Entity\EntityInterface, null given, called in /mnt/www/html/ncigov01test/docroot/profiles/custom/cgov_site/modules/custom/cgov_blog/cgov_blog.tokens.inc on line 88 in Drupal\Core\Entity\EntityRepository->getTranslationFromContext() (line 93 of /mnt/www/html/ncigov01test/docroot/core/lib/Drupal/Core/Entity/EntityRepository.php). request_id="v-54803fc0-0963-11ef-860f-cf6b27598d09"
Additional details / screenshot
Related Tickets