Problem/Motivation
If I restore content that results in an URL alias conflict, I get an error message that the content cannot be restored, but it actually was.
Steps to reproduce
- Enable Pathauto
- Enable Trash for both Content and URL Aliases.
- Create a page with a title of 'Test' (should get an automatic alias of '/content/test')
- Trash that page you just created
- Create another page with a title of 'Test' (should get an automatic alias of '/content/test')
- Attempt to restore your first page from the trash
- You will see an error message saying "The content item ... could not be restored from trash. Cannot restore path alias: An alias with the path "/content/test" already exists"
- However, your item is now out of the Trash and was restored, and is not visible in the Trash listing. It now has an alias of `content/test-0`
Proposed resolution
The error message should be updated or the behavior should be updated to reflect the message?
Remaining tasks
TBD
User interface changes
TBD
API changes
TBD
Data model changes
TBD
Issue fork trash-3570621
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
dave reidComment #5
amateescu commentedOpened a MR with a test to kick things off.
Comment #6
amateescu commentedThe easiest solution would be to wrap the restoring process in a transaction, so exceptions from associated entities can bubble up.
Comment #9
amateescu commentedMerged!