nextcloud / mail

💌 Mail app for Nextcloud
https://apps.nextcloud.com/apps/mail
GNU Affero General Public License v3.0
831 stars 257 forks source link

Created folders cannot be moved to other folders - subfolders moved when renamed #9370

Closed handkerchief333 closed 2 weeks ago

handkerchief333 commented 6 months ago

Steps to reproduce

  1. Create a new folder in a mailbox
  2. Create a new subfolder in this folder
  3. Rename this subfolder
  4. The subfolder is renamed, but moved from the assigned top-level folder to the top level
  5. Try drag & drop the renamed folder back into another folder

Expected behavior

  1. When renaming folders that they still respect the hierarchy they are in.
  2. That you can nest already created folders in other folders.

Actual behavior

  1. Subfolders are automatically moved to the highest level when renamed
  2. You can no longer assign created folders to other folders.

Mail app version

3.5.6

Mailserver or service

No response

Operating system

FreeBSD 13.2

PHP engine version

PHP 8.2

Web server

Apache (supported)

Database

MariaDB

Additional info

Nextcloud v. 28.0.2

ChristophWurst commented 6 months ago

When renaming folders that they still respect the hierarchy they are in.

Keep the browser console and network log open. Inspect the POST request sent when the mailbox is created. Tell us what is sent for name.

I can't reproduce.

handkerchief333 commented 6 months ago

Console log: {"mailbox":{"databaseId":115,"id":"Q2xhbmBlbi9Db2xkL3Rlc2Y=","name":"TestA/TestB/test","accountId":17,"displayName":"test","attributes":[],"delimiter":"/","specialUse":[],"specialRole":0,"mailboxes":[],"syncInBackground":false,"unread":0,"myAcls":null,"shared":false,"envelopeLists":{},"path":"TestA/TestB"}}

Postmessage: {"accountId":17,"name":"TestA/TestB/test"}

Ok I created folder "test" in folder "TestB". Interesting fact. In the folder list, folder "TestB" is at the top level and folder "TestA" is also without displayed subfolders. So there seems to be something wrong with the hierarchy display.

lufer22 commented 5 months ago

Hey, I also faced this problem with renaming a subfolder. To solve it, I made the following code: File: src/components/NavigationMailbox.vue Function: renameMailBox()

[...] try { let newName = this.mailboxName if (this.mailbox.path) { newName = this.mailbox.path + this.mailbox.delimiter + newName } await this.$store.dispatch('renameMailbox', { account: this.account, mailbox: this.mailbox, newName, }) this.renameLabel = true this.renameInput = false [...]

Resuming, I concatenated the whole path to folder's name.

Hope it helps Thanks :D

GretaD commented 2 weeks ago

The renaming issue is fixed here. the drag and drop for mailboxes was never an option on mail. But we do have drag and drop for envelopes, so maybe there was a confusion :)