Problem/Motivation

Deprecated function: Creation of dynamic property Drupal\pathauto\AliasCleaner::$punctuationCharacters is deprecated in Drupal\pathauto\AliasCleaner->getPunctuationCharacters() (line 292 of modules/contrib/pathauto/src/AliasCleaner.php).

Steps to reproduce

On /admin/content select node and under action choose 'Update URL alias'
or at /admin/config/search/path/update_bulk select content and generate Aliases for all

Drupal: 10.0.9
PHP: 8.1

Screenshot of the error attached

Issue fork pathauto-3363661

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

isalmanhaider created an issue. See original summary.

isalmanhaider’s picture

Assigned: Unassigned » isalmanhaider
Status: Needs work » Needs review
johnalbin’s picture

Version: 8.x-1.11 » 8.x-1.x-dev
Status: Needs review » Needs work

The change in #2 works great at getting rid of the deprecation error. But it unintentionally causes the list of punctuation characters to be re-generated every time pathauto needs that list (instead of caching it in a array).

I think this is very close to RTBC.

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

szato’s picture

Assigned: isalmanhaider » Unassigned
Status: Needs work » Needs review

@JohnAlbin agree. I removed
$this->punctuationCharacters = [];

ankitv18’s picture

szato’s picture

Status: Needs review » Closed (duplicate)

It is. I close this one (the linked was created earlier)