Problem/Motivation

At some point I got:

Error: Call to undefined method Drupal\pathauto\VerboseMessenger::addError()

web/modules/contrib/pathauto/src/PathautoGenerator.php:352
web/modules/contrib/pathauto/pathauto.module:91
web/core/lib/Drupal/Core/Extension/ModuleHandler.php:403
web/core/lib/Drupal/Core/Entity/EntityStorageBase.php:206
web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php:756
web/core/lib/Drupal/Core/Entity/EntityStorageBase.php:507
web/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php:(641
(...)

Proposed resolution

Fix it.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

claudiu.cristea created an issue. See original summary.

claudiu.cristea’s picture

Issue summary: View changes
FileSize
495 bytes

Patch.

claudiu.cristea’s picture

Status: Needs work » Needs review
pookmish’s picture

Status: Needs review » Reviewed & tested by the community

Simple fix that got me back on track.

rp7’s picture

Patch in #2 solved the issue for me as well.

el1_1el’s picture

same here for #2. Thanks @claudiu.cristea

Chris Charlton’s picture

+1

Berdir’s picture

Status: Reviewed & tested by the community » Needs work

The fix isn't correct, this is an unfortunate conflict between our own messenger service and the one from drupal core.

This needs to either inject the core messenger service as a differnt property and call addError() on that or rename the current $this->messenger and use the MessengerTrait.

idebr’s picture

Status: Needs work » Needs review
FileSize
3.97 KB
4.35 KB

Attached patch implements the following changes:

  1. $messenger property renamed to $pathautoMessenger to distinguish between the different messenger implementations.
  2. Updated the ->addError($e->getMessage()); method call to use the Drupal core Messenger service using the MessengerTrait

  • Berdir committed a5f8ce1 on 8.x-1.x authored by idebr
    Issue #3003373 by idebr, claudiu.cristea, rp7, pookmish, el1_1el, Chris...
Berdir’s picture

Status: Needs review » Fixed

Thanks.

Status: Fixed » Closed (fixed)

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

marcelovani’s picture

Would be nice to have a release