core icon indicating copy to clipboard operation
core copied to clipboard

Deleting a folder does not delete affected shares fore files within it

Open butonic opened this issue 12 years ago • 11 comments

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

  1. Create folder 'foo'
  2. Create file 'foo/bar.txt'
  3. Share file 'foo/bar.txt' via link
  4. Share folder 'foo' via link
  5. Delete folder 'foo'
  6. 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.

butonic avatar Jan 28 '14 15:01 butonic

@schiesbn

karlitschek avatar Jan 28 '14 15:01 karlitschek

@schiesbn didn't you mention some automatic process to clean up such old data in another ticket ?

PVince81 avatar Mar 12 '14 20:03 PVince81

@schiesbn any update on this ? How does it affect the new sharing ?

PVince81 avatar May 06 '14 10:05 PVince81

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:

  1. in user-management assign some users to a new group
  2. share a folder with that group
  3. delete that folder without unsharing it
  4. remove all group members from that group

Expected behaviour: the group-name should diappear. Instead: the group-name stays

hanibal8 avatar Jun 13 '14 11:06 hanibal8

@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.

PVince81 avatar Dec 05 '14 17:12 PVince81

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)

PVince81 avatar Dec 05 '14 17:12 PVince81

@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

PVince81 avatar Dec 05 '14 17:12 PVince81

We might still want to delete orphaned shares in the background, experimental PR here: https://github.com/owncloud/core/issues/14676

PVince81 avatar Mar 23 '15 17:03 PVince81

Assigning to self, I'd say the bkg job is the way to go now.

PVince81 avatar Mar 23 '15 17:03 PVince81

Fixed through https://github.com/owncloud/core/pull/14676

PVince81 avatar Apr 09 '15 08:04 PVince81

Thx a lot @PVince81

butonic avatar Apr 09 '15 10:04 butonic