Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#9 | 3003373-9.patch | 4.35 KB | idebr |
| |||
#9 | interdiff-2-9.txt | 3.97 KB | idebr |
Comments
Comment #2
claudiu.cristeaPatch.
Comment #3
claudiu.cristeaComment #4
pookmish CreditAttribution: pookmish commentedSimple fix that got me back on track.
Comment #5
rp7 CreditAttribution: rp7 for Government of Flanders commentedPatch in #2 solved the issue for me as well.
Comment #6
el1_1el CreditAttribution: el1_1el commentedsame here for #2. Thanks @claudiu.cristea
Comment #7
Chris Charlton+1
Comment #8
BerdirThe 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.
Comment #9
idebr CreditAttribution: idebr at ezCompany commentedAttached patch implements the following changes:
$messenger
property renamed to$pathautoMessenger
to distinguish between the different messenger implementations.->addError($e->getMessage());
method call to use the Drupal core Messenger service using the MessengerTraitComment #11
BerdirThanks.
Comment #13
marcelovaniWould be nice to have a release