Getting the following error when running using drush cron:

[error] TypeError: Argument 2 passed to Drupal\Core\Controller\TitleResolver::getTitle() must be an instance of Symfony\Component\Routing\Route, null given, called in /app/web/modules/contrib/addtoany/addtoany.module on line 252 in Drupal\Core\Controller\TitleResolver->getTitle() (line 50 of /app/web/core/lib/Drupal/Core/Controller/TitleResolver.php) #0 /app/web/modules/contrib/addtoany/addtoany.module(252): Drupal\Core\Controller\TitleResolver->getTitle(Object(Symfony\Component\HttpFoundation\Request), NULL)

Seems to happen when cron runs for core search and the block is used in a content type inserted through layout builder.

Comments

dsdeiz created an issue. See original summary.

dsdeiz’s picture

Status: Active » Needs review
StatusFileSize
new1.96 KB

Patch added.

dsdeiz’s picture

StatusFileSize
new1.93 KB
kirkkala’s picture

Thanks, patch #2 fixes also our issue where we insert the block through displaysuite/patternlab components.

One small note to the patch it would be good to have additional safety-check if the $node variable really is instanceof Drupal\node\NodeInterface (or Drupal\node\Entity\Node).

nord102’s picture

Updated the patch from #3 with the suggestion of checking instanceof NodeInterface from #4

rang501’s picture

The #5 patch didn't solve my issue, made an additional change in addtoany.module.

The error was triggered by running search api indexing with drush.

  • micropat committed 0f8f222 on 8.x-1.x authored by rang501
    Issue #3155640 by dsdeiz, nord102, rang501:  [error]  TypeError:...
micropat’s picture

Status: Needs review » Fixed

Thanks for the patches! This should make the next release.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.