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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alberto56 created an issue. See original summary.

idebr’s picture

Status: Active » Needs review
FileSize
1.81 KB

#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.

alberto56’s picture

Status: Needs review » Reviewed & tested by the community

Looks good and works perfectly, thanks!

laughnan’s picture

+1

This patch worked for me as well.

micahw156’s picture

+1 for this patch to fix errors I encountered after updating to pathauto 8.x-1.4.

Berdir’s picture

Status: Reviewed & tested by the community » Fixed

Fair 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.

  • Berdir committed 176b576 on 8.x-1.x authored by idebr
    Issue #3047196 by idebr: Injection on PathautoGenerator (3031650) causes...

Status: Fixed » Closed (fixed)

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