Project

General

Profile

Actions

Bug #104194

open

File move flash message does not display previous location

Added by Pierrick Caillon 5 days ago. Updated 3 days ago.

Status:
Under Review
Priority:
Should have
Assignee:
-
Category:
Backend User Interface
Target version:
-
Start date:
2024-06-24
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.2
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

Description

When moving a file using default clipboard in v12, the success message contains the destination path as source path too. It should display the old path. See screenshot.

Text translation:

File "[…]" moved to "[…]".


Files

2024-06-24_141830.png (4.95 KB) 2024-06-24_141830.png Pierrick Caillon, 2024-06-24 12:21
Actions #1

Updated by Georg Ringer 5 days ago

  • Status changed from New to Accepted

patch would be

diff --git a/typo3/sysext/core/Classes/Utility/File/ExtendedFileUtility.php b/typo3/sysext/core/Classes/Utility/File/ExtendedFileUtility.php
index 537b3e01b1..bae65814fb 100644
--- a/typo3/sysext/core/Classes/Utility/File/ExtendedFileUtility.php
+++ b/typo3/sysext/core/Classes/Utility/File/ExtendedFileUtility.php
@@ -691,6 +691,7 @@ class ExtendedFileUtility extends BasicFileUtility
         // Moving the file
         if ($sourceFileObject instanceof File) {
             try {
+                $sourcePath = $sourceFileObject->getIdentifier();
                 if ($alternativeName !== '') {
                     // Don't allow overwriting existing files, but find a new name
                     $resultObject = $sourceFileObject->moveTo($targetFolderObject, $alternativeName, DuplicationBehavior::RENAME);
@@ -698,8 +699,8 @@ class ExtendedFileUtility extends BasicFileUtility
                     // Don't allow overwriting existing files
                     $resultObject = $sourceFileObject->moveTo($targetFolderObject, null, DuplicationBehavior::CANCEL);
                 }
-                $this->writeLog(SystemLogFileAction::MOVE, SystemLogErrorClassification::MESSAGE, 'File "{identifier}" moved to "{destination}"', ['identifier' => $sourceFileObject->getIdentifier(), 'destination' => $resultObject->getIdentifier()]);
-                $this->addMessageToFlashMessageQueue('FileUtility.FileMovedTo', [$sourceFileObject->getIdentifier(), $resultObject->getIdentifier()], ContextualFeedbackSeverity::OK);
+                $this->writeLog(SystemLogFileAction::MOVE, SystemLogErrorClassification::MESSAGE, 'File "{identifier}" moved to "{destination}"', ['identifier' => $sourcePath, 'destination' => $sourceFileObject->getIdentifier()]);
+                $this->addMessageToFlashMessageQueue('FileUtility.FileMovedTo', [$sourcePath, $sourceFileObject->getIdentifier()], ContextualFeedbackSeverity::OK);
             } catch (InsufficientUserPermissionsException $e) {
                 $this->writeLog(SystemLogFileAction::MOVE, SystemLogErrorClassification::USER_ERROR, 'You are not allowed to move files');
                 $this->addMessageToFlashMessageQueue('FileUtility.YouAreNotAllowedToMoveFiles');


will push later

Actions #2

Updated by Gerrit Code Review 3 days ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/84923

Actions

Also available in: Atom PDF