Problem/Motivation
1. When using Quick Node Clone, the validation is not applied because the module only checks for 'default' and 'edit' form operations.
2. Additionally, some pathauto patterns use tokens like [node:menu-link:*] which call toUrl() internally. For new/cloned entities, this throws an EntityMalformedException because the entity doesn't have an ID yet.
Steps to reproduce
With unique_alias_checker installed & enabled, clone a node using Quick Node Clone. New cloned node will have -0 appended to URL, indicating a duplicate URL exists.
Proposed resolution
1. Add 'quick_node_clone' to the list of allowed form operations.
2. Handle new entities by setting $source to NULL and wrapping token replacement in try/catch. If token replacement fails due to menu-link tokens, fall back to a pattern without those tokens.
Issue fork unique_alias_checker-3583789
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
Comment #2
calvin.horsford commentedCreated merge request. This adds 'quick_node_clone' to the list of form operations that trigger validation, allowing the module to work with Quick Node Clone.
Comment #3
calvin.horsford commentedComment #6
mdranove commentedI tested this out on a drupal 11 install. Was able to repro the two issues.
Here's what I found.
Comment #7
mdranove commentedI went back in to look at this again and couldnt repro the issue I mentioned above. Thanks for adding the gitlab file, ill fix those as part of this. Moving into rtbc temporarily.
Comment #9
mdranove commentedActually going to do phpstan in a separate ticket.