Deleting a folder does not delete affected shares fore files within it
Expected behaviour
When deleting a folder all shares on files within should be deleted as well
Actual behaviour
Only the share for the folder is deleted. Other shares are left in place, cluttering up the oc_share table
Steps to reproduce
- Create folder 'foo'
- Create file 'foo/bar.txt'
- Share file 'foo/bar.txt' via link
- Share folder 'foo' via link
- Delete folder 'foo'
- use sql and
SELECT * FROM oc_share WHERE file_target='/bar.txt'to see the leftover share row in the db
@schiesbn @karlitschek something to consider for sharing.
@schiesbn
@schiesbn didn't you mention some automatic process to clean up such old data in another ticket ?
@schiesbn any update on this ? How does it affect the new sharing ?
Also, what I encountered is that if you share that folder with a Group and delete the folder then without unsharing it ... the Group name will stay in the user management even if all members are removed from the group.
Steps to reproduce:
- in user-management assign some users to a new group
- share a folder with that group
- delete that folder without unsharing it
- remove all group members from that group
Expected behaviour: the group-name should diappear. Instead: the group-name stays
@schiesbn still occurs on OC 7.0.4 RC1
@hanibal8 your issue seems to be different, apparently you are expecting that when you delete all users from a group the empty group gets deleted. I think it is fine to keep empty groups. OC 7.0.3 makes it possible to delete groups in the UI, so these can be deleted now by the admin.
Interesting, so this is a way to create orphaned share entries from the UI.
Also happens when sharing with a user instead of with a link. And also happens on OC 8 pre-alpha (master 89db2a027701503ea758380b20b10ca7f5a244d9)
@schiesbn would it be easier to remove these entries without resorting to cleanup scripts, especially with the way how shares are implemented in OC 7 ?
The orphaned cleanup ticket is here: #12323
We might still want to delete orphaned shares in the background, experimental PR here: https://github.com/owncloud/core/issues/14676
Assigning to self, I'd say the bkg job is the way to go now.
Fixed through https://github.com/owncloud/core/pull/14676
Thx a lot @PVince81