Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't relocate file to root folder when renaming #12999

Merged
merged 3 commits into from
Mar 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- Fixed a bug where asset pagination was broken when there was more than 100 subfolders. ([#12969](https://github.com/craftcms/cms/issues/12969))
- Fixed a bug where entry index pages’ “Revision Notes” and “Last Edited By” columns weren’t getting populated for disabled entries. ([#12981](https://github.com/craftcms/cms/issues/12981))
- Fixed a JavaScript error that occurred when closing a disclosure menu within Live Preview. ([#12992](https://github.com/craftcms/cms/issues/12992))
- Fixed a bug where assets were getting relocated to the root volume folder when renamed. ([#12995](https://github.com/craftcms/cms/issues/12995))

## 3.8.5 - 2023-03-21

Expand Down
8 changes: 7 additions & 1 deletion src/elements/actions/RenameFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,15 @@ public function getTriggerHtml()

Craft.elementIndex.setIndexBusy();

let currentFolderId = Craft.elementIndex.\$source.data('folder-id');
const currentFolder = Craft.elementIndex.sourcePath[Craft.elementIndex.sourcePath.length - 1];
if (currentFolder && currentFolder.folderId) {
currentFolderId = currentFolder.folderId;
}

var data = {
assetId: assetId,
folderId: Craft.elementIndex.\$source.data('folder-id'),
folderId: currentFolderId,
filename: newName
};

Expand Down