Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After "empty recycle bin" the linked "UMB" entries are not deleted too. #10901

Closed
a-t-k opened this issue Aug 19, 2021 · 2 comments
Closed

After "empty recycle bin" the linked "UMB" entries are not deleted too. #10901

a-t-k opened this issue Aug 19, 2021 · 2 comments
Labels

Comments

@a-t-k
Copy link

a-t-k commented Aug 19, 2021

Which exact Umbraco version are you using? For example: 8.13.1 - don't just write v8

8.15.2

Bug summary

Create child item
Create parent Item with "Multinode Treepicker"
On parent Item add child item in "Multinode Treepicker"

When
1 - Delete child Item (it is now "recycle bin" and has flag "recycled")
2 - Empty recycle bin, so item is deleted

Then
Parent item has in "Multinode Treepicker" entry for deleted child item "umb://document/5b51c940579c4231b3e662eb2b3d3f6f"

Specifics

Create child item
Create parent Item with "Multinode Treepicker"
On parent Item add child item in "Multinode Treepicker"

When
1 - Delete child Item (it is now "recycle bin" and has flag "recycled")
2 - Empty recycle bin, so item is deleted

Then
Parent item has in "Multinode Treepicker" entry for deleted child item "umb://document/5b51c940579c4231b3e662eb2b3d3f6f"

Steps to reproduce

Create child item
Create parent Item with "Multinode Treepicker"
On parent Item add child item in "Multinode Treepicker"

When
1 - Delete child Item (it is now "recycle bin" and has flag "recycled")
2 - Empty recycle bin, so item is deleted

Then
Parent item has in "Multinode Treepicker" entry for deleted child item "umb://document/5b51c940579c4231b3e662eb2b3d3f6f"

Expected result / actual result

The entry "umb://document/5b51c940579c4231b3e662eb2b3d3f6f" is deleted too.

@a-t-k a-t-k added the type/bug label Aug 19, 2021
@nathanwoulfe
Copy link
Contributor

Hi @a-t-k, I believe this is by design - it would be an expensive operation for Umbraco to find and remove all references to the deleted node, as it would require updating properties, caches and so on. This would be compounded if the deleted node had children/descendants.

However, IMO it's not really an issue, please see my repro steps:

  • I create a child node, then link to it from a MNTP in the parent node, then delete the child.
  • When I reload the parent, I see the below, which makes it obvious to editors that the referenced node needs to be removed:
    image
  • If I then empty the recycle bin and reload the parent, the MNTP property does still have the UDI of the deleted item in the data, but it's not displayed
  • saving the document removes the reference to the deleted node as the property editor has updated the value when it was unable to retrieve the linked entity.

From what I can see, ModelsBuilder manages this fine on the frontend - the deleted node isn't in the property data when I render the page, I'm assuming the property value converter is ignoring unpublished/trashed entities.

@nul800sebastiaan
Copy link
Member

Indeed this is very much by design to make sure that deleting an item doesn't cause a big cascade of having to look through potentially 1000s of nodes, reading and/or deserializing (1000s * each property) on each node to check for orphans and then potentially having to write and republish (1000s * each property).

As mentioned all property editors should gracefully be handling missing references. If they don't then we can look into that.

As for your frontend, this requires a bit of defensive coding, so you should always expect that a UDI does not exist any more while writing code for your templates.

Hope this provides some clarity and I'll close the issue as "by design".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants