Title: Fix TypeError in SimpleSocialShareBlock during search indexing when route is null

Description: Problem: When running search indexing (e.g., via drush search-api:index), a TypeError occurs in SimpleSocialShareBlock::build(). This happens because the block attempts to retrieve the current page title using the current route, but in the indexing context (CLI), \Drupal::routeMatch()->getRouteObject() returns null.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

  • 1.0.x Comparechanges, plain diff MR !2
  • 3560016 Comparecompare

Comments

ahmad-alyasaki created an issue. See original summary.

  • cdc75502 committed on 1.0.x
    fix: #3560016 Fix TypeError in SimpleSocialShareBlock when route is null
    
ahmad-alyasaki’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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