PHP Fatal error: Cannot redeclare Drupal\domain_entity\HttpKernel\DomainEntitySourcePathProcessor::$sourceMapper

Created on 11 March 2025, about 1 month ago

Problem/Motivation

I just updated to 8.x-1.0-rc5 and have recieved a WSOD and the following message:

Fatal error: Cannot redeclare Drupal\domain_entity\HttpKernel\DomainEntitySourcePathProcessor::$sourceMapper in /web/modules/contrib/domain_entity/src/HttpKernel/DomainEntitySourcePathProcessor.php on line 112

Steps to reproduce

Upgrade from rc1 (the version I was on) to rc5 and you'll immediately see the error on the website. Running any drush command on the command line will also print the error.

In the offending DomainEntitySourcePathProcessor.php file you will see the $sourceMapper is indeed declared twice:

/**
   * DomainEntitySourceMapper service.
   *
   * @var \Drupal\domain_entity\DomainEntitySourceMapper
   */
  protected DomainEntitySourceMapper $sourceMapper;

  /**
   * The domain entity source mapper.
   *
   * @var \Drupal\domain_entity\DomainEntitySourceMapper
   */
  protected $sourceMapper;

Proposed resolution

Remove the duplicate $sourceMapper declaration.

Remaining tasks

Remove the duplicate $sourceMapper declaration.
Test.

User interface changes

None.

API changes

None.

Data model changes

None.

🐛 Bug report
Status

Active

Component

Code

Created by

🇬🇧United Kingdom darren.fisher

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024