In #3031650: Injection on PathautoGenerator which is now in the latest stable release, it says:
Let's add an empty post_update hook so the services container is rebuilt, see \taxonomy_post_update_clear_entity_bundle_field_definitions_cache() for an example. Existing sites will trigger an error: ArgumentCountError: Too few arguments to function Drupal\pathauto\PathautoGenerator::__construct()
However I have managed to reproduce a scenario where we get the "Too few arguments" problem when upgrading between stable releases of Webform and Pathauto.
To full steps to reproduce are at #3046852: Too few arguments PathautoGenerator::__construct() when upgrading from webform-5.1 + pathauto-8.x-1.3 to wf-5.2 + pa-8.x-1.4.
Comment | File | Size | Author |
---|---|---|---|
#2 | pathauto-optional_alias_type_manager-3047196-2.patch | 1.81 KB | idebr |
|
Comments
Comment #2
idebr CreditAttribution: idebr at ezCompany commented#3031650-4: Injection on PathautoGenerator suggested to make the constructor argument optional, but that suggestion was not implemented before the patch was committed.
Attached patch adds the suggested change.
Comment #3
alberto56 CreditAttribution: alberto56 at Dcycle commentedLooks good and works perfectly, thanks!
Comment #4
laughnan+1
This patch worked for me as well.
Comment #5
micahw156+1 for this patch to fix errors I encountered after updating to pathauto 8.x-1.4.
Comment #6
BerdirFair enough ,committed. Not sure why so many struggle with this though, this should go away after a cache clear, which you should always do when updating code/modules.