Cannot redeclare Drupal\pathauto\AliasCleaner::$punctuationCharacters

Created on 27 October 2023, about 1 year ago

Problem/Motivation

I am experiencing an unexpected error that does not seem to be caused by any local module and/or configuration. I'm not sure if it is a Webform issue or a Pathauto issue. The error (that does not appear in the logs) reads:

Cannot redeclare Drupal\pathauto\AliasCleaner::$punctuationCharacters in /var/www/html/web/modules/contrib/pathauto/src/AliasCleaner.php on line 85

Because I'm working on a new project, I'm using the latest and greatest (which might or might not be relevant) :
Drupal 10.1.5
PHP 8.2.11
Webform 6.2.0-rc3
Pathauto 1.12.0
Honeypot 2.1.3 (enabled for all webforms)

Steps to reproduce

To reproduce:
- Create/Open a Drupal website that matches the above versions and packages.
- Make sure you are logged in as a user that is allowed to add/edit webforms
- Navigate to the Webforms overview page (/admin/structure/webform)
- Open the developers console of your browser (F12 in Chrome, CMD + opt + I on Safari, right-click: Inspect element and switch to Console tab)
- Enter a (unique) title for the new webform. As soon as you click the save-button, the above error appears in the console.
- If you refresh the page afterwards, you will see the Webform overview will include the newly created form.

Or, if you have an existing webform:
- Try to submit the webform. Submitting the webform will show an all-white error page, only including the error mentioned above.

The error is present on both a local dockerized environment, as on a (pre)-production environment running the same release / versions.

🐛 Bug report
Status

Closed: works as designed

Version

1.12

Component

Code

Created by

🇳🇱Netherlands Dimiter

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Dimiter
  • Status changed to Closed: works as designed about 1 year ago
  • 🇳🇱Netherlands Dimiter

    D'OH!

    After submitting this issue, I had another look and I found the culprit:

    I had earlier applied a patch for D10 / PHP 8.2 compatibility provided by issue #3328670, patch in #2 📌 PHP 8.2 compatibility Fixed . Apparently that patch still applied without issues agains release 1.12, that does also include the final fix for that issue and should not require the patch any more. After removing the patch, re-installing the module using composer and clearing the cache everything works great again!

    I'll close the issue, hoping that my findings might still help someone one day :)

Production build 0.71.5 2024