- πͺπΈSpain isholgueras
I've tested in in a Drupal 10.3, sharethis version 3.0.2 and #2 fixes the issue. RTBC for me.
Under some circumstances there is no route object to pass through to TitleResolver::getTitle(), which causes the following error:
TypeError: Argument 2 passed to Drupal\Core\Controller\TitleResolver::getTitle() must be an instance of Symfony\Component\Routing\Route, null given, called in /var/www/html/domain.com/docroot/modules/contrib/sharethis/src/Plugin/Block/SharethisWidgetBlock.php on line 159 in Drupal\Core\Controller\TitleResolver->getTitle() (line 50 of /var/www/html/domain.com/docroot/core/lib/Drupal/Core/Controller/TitleResolver.php).
The problem here is that there is an assumption that there is an active route in the request, but we have found that when we indexed the rendered HTML of entities using Search API via Cron, there is no active route.
1. Create an entity or content type with share this functionality
2. Create a solr/elasticsearch/whatever index using Search API
3. Add rendered_item as an indexed field for the content type you have configured
4. Install ultimate cron
5. Set up cron to run via drush
6. Let cron run naturally
7. Check the Search API cron task in ultimate cron for errors
8. You should see the issue above.
Check that $this->routeMatch->getRouteObject(); in ShareThisManager.php and ShareThisWidgetBlock.php actually has a value before passing it to $this->titleResolver->getTitle().
None
None
None
None
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
I've tested in in a Drupal 10.3, sharethis version 3.0.2 and #2 fixes the issue. RTBC for me.