Problem/Motivation

The edit form loads an existing condition, but the shared submit handler saves it with `$pattern->addSelectionCondition($condition->getConfiguration())`. Pathauto's `addSelectionCondition()` always generates a new UUID, so saving an edit creates another condition instead of replacing the existing condition.

Issue -2

Issue -1

Steps to reproduce

  1. Install Pathauto and Pathauto Conditions UI.
  2. Go to Configuration → Search & Metadata → URL aliases → Patterns and open any pattern.
  3. Click Manage conditions → Add condition, pick something like Node type, configure it, and save. (This is the "unlocked condition".)
  4. Click Edit on that same condition, change any setting, and save.
  5. Go back to Manage conditions or check selection_criteria in config storage.

Expected

The condition is updated in place.

Actual

A duplicate condition appears — two entries now exist instead of one updated one.

Proposed resolution

In the edit flow, update the existing condition instance/configuration instead of calling `addSelectionCondition()`, or remove the old condition ID before adding the updated configuration.

CommentFileSizeAuthor
issue-2.png62.29 KBdkmishra
issue-1.png38.57 KBdkmishra

Comments

dkmishra created an issue.