modxcms / revolution

MODX Revolution - Content Management Framework
https://modx.com/
GNU General Public License v2.0
1.36k stars 528 forks source link

Restore a deleted parent, when a deleted child is restored. #14368

Open Jako opened 5 years ago

Jako commented 5 years ago

Feature request

Summary

Restore a deleted parent, when a deleted child is restored.

Why is it needed?

Not deleted children of a deleted parent would be purged too, when the resource trash is purged. After #14350 they are shown in the trash, but that is not an obvious behavior.

Suggested solution(s)

Automatically restore all parents of a restored (undeleted) resource (maybe with a warning).

Related issue(s)/PR(s)

14350

Jako commented 5 years ago

This could be solved different, when the model does not allow undeleted children of deleted resources, but then some other issues have to be solved:

Solving the drag&drop issue nice could be difficult, but the other parts could be changed with the model or with a validator.

Ruslan-Aleev commented 5 years ago

You can also create a resource and then change its parent to the deleted one in the settings (perhaps this is also the same as dragging to the deleted parent).

SnowCreative commented 5 years ago

This issue was pushed over to 3.X, so I'm reposting this suggestion here.

To me the most user-friendly option would be this: If there is an undeleted resource under a deleted folder (either because someone dragged it there or manually undeleted it after the parent was deleted), when purging the parent, an alert would pop up like the following: The resource "[resource name]" is not marked for deletion but its parent will now be deleted. Delete this resource as well, or move it upwards in the tree? Then you'd have the option to either delete the undeleted resource, or move it up in the tree to the closest undeleted parent.

Jako commented 5 years ago

@rainbowtiger At the moment I would prefer to don't accept a deleted resource as a drop target in the tree (if that's possible). The same for the parent dropdown. An undelete for children of deleted parents should not be possible too.