Bulk update with first option create don't work on content with pattern

Created on 15 February 2023, almost 2 years ago
Updated 11 September 2024, 2 months ago

Problem/Motivation

Even when some nodes types have a dedicated pattern on type + language, and the named node has no alias, bulk update on empty aliases doesn't generate any alias.

Steps to reproduce

1. Install Drupal Core
2. Install module pathauto
3. enable path and pathauto
4. enable languages and translations for nodes.
5. create 1 more language
6. create a node type
7. create a pattern for the created node type + dedicated language
8. Create a node of created type
9. Select its language
10. go to pathauto bulk page: /admin/config/search/path/update_bulk
11. choose options "content" and "Generate an alias only for empty aliases."
12. Click on "update" button
13. edit the node.
14: check the alias : this one should be set, but it is not.

Proposed resolution

After investigation, I've found that nearly every nodes had a pathauto status 0 instead of 1 ($entity->path->pathauto).
And if this status is 0 + not 'force' option on it, then it isn't updated :-(

Remaining tasks

Somewhere $entity->path->pathauto should be turned on 1 and it isn't.

I can propose a patch that force this value to be updated during the bulk update.

Please tell me if there is a better way to fix this.

🐛 Bug report
Status

Needs review

Version

1.13

Component

Code

Created by

🇫🇷France frondeau Nantes, FRANCE

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

Comments & Activities

Production build 0.71.5 2024