Problem/Motivation

Once I clean the cache in Drupal 8.9.9 I get the following error:

PHP Fatal error: Type of Drupal\pathauto\Form\PatternEditForm::$entityTypeManager must be Drupal\Core\Entity\EntityTypeManagerInterface (as in class Drupal\Core\Entity\EntityForm) in /var/www/html/web/modules/contrib/pathauto/src/Form/PatternEditForm.php on line 297

Steps to reproduce

Install the module
Clean the cache

Proposed resolution

Delete the $entityTypeManager property as the same property is defined in the parent class.

Remaining tasks

Test the patch.

User interface changes

None.

API changes

None.

Data model changes

None.

CommentFileSizeAuthor
#7 pathauto-3186627.patch2.15 KBadriancid

Issue fork pathauto-3186627

Command icon 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

adriancid created an issue. See original summary.

drupalviking’s picture

Setup a fresh instance of Drupal 8.9.9. Then used composer require 'drupal/pathauto:1.x-dev@dev' to fetch the module. Installed with drush and rebuilt the cache. The error did not occur. Where you using a fresh instance?

drupalviking’s picture

I can concur that the changes of the module (removing the EntityTypeManager from the form) did not break the module, so the code patch work, generally.

berdir’s picture

What PHP version? Those properties do not have a type declaration? That language feature only exists since PHP 8 and Drupal 8.9 isn't PHP 8 compatible nor would it use syntax that requires PHP 8.

Fine to remove it as that property exists at least since 8.8 in the base class, but don't see why such an error would happen unless you somehow changed core.

adriancid’s picture

@berdir, is not a fresh install, I have other modules and maybe this is how I found the problem. I don't have any change in core.

I'm using PHP 7.4.3. The site is working well except for some pages where I found the error, after apply the patch where I delete the property all is working fine.

adriancid’s picture

Status: Active » Needs review
StatusFileSize
new2.15 KB

mably made their first commit to this issue’s fork.

mably’s picture

Status: Needs review » Closed (outdated)

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.