Closed (duplicate)
Project:
Pathauto
Version:
8.x-1.15
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
11 Aug 2026 at 09:50 UTC
Updated:
24 Sep 2026 at 07:35 UTC
Jump to comment: Most recent
Deprecated function: Using null as an array offset is deprecated, use an empty string instead in Drupal\pathauto\PathautoGenerator->getPatternByEntity() (line 368 of modules/contrib/pathauto/src/PathautoGenerator.php).
Deprecated function: Using null as an array offset is deprecated, use an empty string instead in Drupal\pathauto\PathautoGenerator->getPatternByEntity() (line 371 of modules/contrib/pathauto/src/PathautoGenerator.php).
| Comment | File | Size | Author |
|---|---|---|---|
| pathauto-null-array-offset-getPatternByEntity-1.15.0.patch | 1.49 KB | trickfun |
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
Comment #3
chaitanyadessai commentedThanks for the report and patch. Looking at the issue fork branch (3616056-deprecated-function-using), this is already resolved commit 3d62a74 (landed for #3579655, "Deprecated error with PHP 8.5 on entity forms without pathauto patterns") restructured getPatternByEntity() to check $entity->isNew() and return early before any array indexing happens, so $entity->id() is never used as an array offset for new/unsaved entities anymore. That's the same root cause this issue describes ($entity->id() returning NULL for new entities), just fixed via a different, more thorough refactor than the attached patch.
Comment #4
lisotton commented