modxcms / revolution

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

Deleting resources - small bugs #14167

Open Ruslan-Aleev opened 5 years ago

Ruslan-Aleev commented 5 years ago

1) You can restore only a children resource in the trash manager (it disappear from the list in trash manager), but the parent will not be restored. And if you click "Purge resource", then everything will be deleted, but the message will be only about the parent.

Need a connection between deleted resources - parent and children. It makes sense to activate and freeze the setting "Deleted" in children resources until the parent is deleted OR restore parent if children been restored OR change the parent to 0 and set the resource to unpublised, if it has been restored and its parent has been deleted.

p.s. It is odd that you can create or restore a children resource if the parent has been deleted.

del_bug_2

2) If you delete a resource through its setting, then its child resources will be deleted, but at the same time they will be marked as not deleted in the tree, which can confuse users.

See https://github.com/modxcms/revolution/issues/14167#issuecomment-535401489

3) If we transfer the Home page or other system page ("404", "Site is not available") inside any resource, then by deleting this prent resource we will delete the system pages as well. However, if they are located in the root, then it will not be possible to delete system pages, the check will work.

Jako commented 5 years ago

I don't think that 2. could be solved nice. Purge them too could be too harsh. We need some 'search for orphan resources' processor otherwise, since those resources can't be found in the tree after purging.

Deleted parents and not deleted children could happen in other circumstances too.

Jako commented 5 years ago

I just checked that on a current installation. The child resources are purged too, even if they are not deleted. They don't stay as orphaned resources. So the child resources 'just' have to be listed in the trash manager.

Ibochkarev commented 5 years ago

@Jako Hello! Can you fix it

Ruslan-Aleev commented 5 years ago

Now there is a problem in that if you delete a resource through its setting, then its child resources will be deleted, but at the same time they will be marked as not deleted in the tree, which can confuse users.

deleted

Although if you delete via the context menu, the child resources will also be marked as deleted.

If you have a large resource tree and a lot of deleted resources in the trash, then you may simply not understand what will be deleted, which is a serious problem.

I think that it is necessary to mark child resources deleted if the parent has been deleted (as delete works through the context menu now)

A detailed discussion was here https://github.com/modxcms/revolution/pull/14350