I upgraded to latest Pathauto (&Token) today, in latest Drupal 8 release.
when I clicked Edit on a book page, I got the following error
-- I then downgraded to Pathauto 1.6 and editing worked fine again.
TypeError: Argument 5 passed to Drupal\pathauto\AliasUniquifier::__construct() must implement interface Drupal\path_alias\AliasManagerInterface, instance of Drupal\Core\Path\AliasManager given,
called in .../core/lib/Drupal/Component/DependencyInjection/Container.php
on line 285 in Drupal\pathauto\AliasUniquifier->__construct() (line 66 of .../modules/pathauto/src/AliasUniquifier.php)
#0 .../core/lib/Drupal/Component/DependencyInjection/Container.php(285):
Drupal\pathauto\AliasUniquifier->__construct(Object(Drupal\Core\Config\ConfigFactory), Object(Drupal\pathauto\AliasStorageHelper), Object(Drupal\Core\Extension\ModuleHandler), Object(Drupal\Core\Routing\RouteProvider), Object(Drupal\Core\Path\AliasManager))
...
Steve
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | 3131460-15.patch | 1.71 KB | ankitv18 |
Issue fork pathauto-3131460
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:
Comments
Comment #2
joelpittetBumping the version to -dev and priority major.
I did an accidental similar thing on menu_position release recently, should be a straightforward fix. I'll look into it shortly.
Comment #3
berdirDid you clear caches after updating? You might still have old service definitions.
Comment #4
joelpittetSorry, so far clearing cache worked. @Berdir on menu_position I added
hook_post_update_NAMEto force cache clear, maybe something you could do too for service changes?https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Extension...
Comment #5
berdirYeah. I think everyone should always clear caches on code changes, but I tend to forgot that too many people don't, and I think update.php doesn't clear caches if there are no updates, which is awkward. I find adding empty post updates an ugly solution, as every executed post update needs to be stored basically forever in drupal and compared against the list of defined updates to see if there's something that still needs to run.
An easier option is to make new arguments optional with a \Drupal::service() fallback like the core BC pattern, then it works even without a cache clear. But that wasn't an option here as we really did change the argument and had to, it's the same thing with a new name/namespace.
If someone provides a patch to add a post update then I'm open to commit that.
Comment #6
joelpittetYeah they are a bit messy but don't bump the schema for cache clears, so slightly nicer in some ways, I don't know.
I'll let someone else who comes up with this issue to create a patch with a post update hook, setting this to Active as it seems like cache clear is the solution, feel free to set it back if you still need more info.
Comment #7
saweyer commentedI usually Flush Caches (from Admin menu) before Run Updates -- not 100% sure this time.
Steve
Comment #8
Robhern135 commentedJust dropping in to say that I found this same issue, and clearing all caches fixed it.
Comment #9
mturner20 commentedClearing all caches solved this error for me also!
Comment #10
saweyer commentedI installed latest (1.8) today, did Flush Caches -- no problems. Steve
Comment #11
luismagr commentedMe too. I solved the problem clearing the cache
Comment #12
capricorn1 commentedSimilar in my case except I had updated with Composer. There was an additional database update afterward, which I didn't find out about due to troubles logging in after moving to a new server. After doing the update and clearing all caches, the error went away.
Comment #13
sershevchykI try to update drupal core and modules and have an error when I run
drush updb -y(cache was cleared) commandIn this log I see module
admin_toolbar_tools, mayve problem thereComment #14
ankitv18 commentedI just upgraded to Drupal Core Version 8.9.13 and eventually updated the pathauto to 1.8
Running composer update upgrade the pathauto too.
TypeError: Argument 5 passed to Drupal\pathauto\AliasUniquifier::__construct() must implement interface Drupal\path_alias\AliasManagerInterface, instance of Drupal\Core\Path\AliasManager given.+1 for #13
Clearing cache multiple times still facing this issue.
Comment #15
ankitv18 commentedComment #16
ankitv18 commentedPlease test & review this patch for this constructor issue.
Comment #17
ankitv18 commentedComment #19
berdirThis change is not correct, this is the old, deprecated class, the new should work since Drupal 8.8 but you must update first. Update to Drupal 8.9 with an older version. (Or by using the patch, but then you can remove that again).