groupfolders icon indicating copy to clipboard operation
groupfolders copied to clipboard

Deleting group folder does not un-assign groups

Open rawtaz opened this issue 2 years ago โ€ข 1 comments

TL;DR

FolderManager::removeFolder() needs the following added at the very end of itself:

$query->delete('group_folders_groups')
	->where($query->expr()->eq('folder_id', $query->createNamedParameter($folderId, IQueryBuilder::PARAM_INT)));
$query->executeStatement();

How to use GitHub

  • Please use the ๐Ÿ‘ reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Steps to reproduce

  1. Create a group folder.
  2. Assign a group to it (this relation gets saved in the *_group_folders_groups table).
  3. Delete the group folder.

Expected behaviour

The entry in the *_group_folders_groups table, for the no longer existing group folder, should have been deleted along with the group folder.

Actual behaviour

The entry in the *_group_folders_groups table, for the no longer existing group folder, is still there.

Server configuration

Operating system: Irrelevant.

Web server: Irrelevant.

Database: Irrelevant.

PHP version: Irrelevant.

Nextcloud version: Irrelevant.

Group folders version: 12.0.3

Updated from an older Nextcloud/ownCloud or fresh install: Irrelevant.

Where did you install Nextcloud from: Irrelevant.

Are you using external storage, if yes which one: Irrelevant.

Are you using encryption: Irrelevant.

Are you using an external user-backend, if yes which one: Irrelevant.

Client configuration

Browser: Irrelevant.

Operating system: Irrelevant.

Logs

Irrelevant.

Web server error log

Web server error log

Nextcloud log (data/nextcloud.log)

Nextcloud log

Browser log

Browser log

Comments

The code in Application::boot() combined with the code in FolderManager::deleteGroup()makes deletion of groups in Nextcloud also delete the corresponding entries in the *_group_folders_groups table. So that part works.

However, it's clear from the code in FolderManager::removeFolder() that it only removes the folder and does not touch the *_group_folders_groups table. That's the reason for the set of snarky "Irrelevant" answers above (I don't mean to come across as dismissive).

rawtaz avatar Mar 14 '23 10:03 rawtaz

cc @icewind1991 @juliushaertl

kesselb avatar Mar 14 '23 11:03 kesselb