Skip to content
Snippets Groups Projects
Commit ee066492 authored by Marcin Sągol's avatar Marcin Sągol Committed by Benjamin Franzke
Browse files

[TASK] Improve file rename duplicate warning message

Improve the warning message presented to the user when a file is renamed
through the Filelist module and a file with the new name already exists.

Resolves: #91299
Releases: master
Change-Id: If1ff921396f782c1f560fdb092755e306344d0f3
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64427


Reviewed-by: default avatarMarkus Klein <markus.klein@typo3.org>
Reviewed-by: default avatarWouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: default avatarDaniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: default avatarBenjamin Franzke <bfr@qbus.de>
Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: default avatarDaniel Goerz <daniel.goerz@posteo.de>
Tested-by: default avatarBenjamin Franzke <bfr@qbus.de>
parent 56269a97
Branches
Tags
No related merge requests found
......@@ -51,7 +51,7 @@ class RenameFile {
if (fileExists && originalFileName !== newFileName) {
const description: string = TYPO3.lang['file_rename.exists.description']
.replace('{0}', originalFileName).replace('{1}', newFileName);
.replace('{0}', originalFileName).replace(/\{1\}/g, newFileName);
const modal: JQuery = Modal.confirm(
TYPO3.lang['file_rename.exists.title'],
......
......@@ -22,9 +22,7 @@
<source>File exists already</source>
</trans-unit>
<trans-unit id="file_rename.exists.description" resname="file_rename.exists.description">
<source>You want to rename the file "{0}" to "{1}", but such a file already exists. How do you want to
proceed?
</source>
<source>You want to rename the file "{0}" to "{1}", but the file "{1}" already exists. How do you want to proceed?</source>
</trans-unit>
<trans-unit id="file_rename.actions.cancel" resname="file_rename.actions.cancel">
<source>Cancel</source>
......
......@@ -10,4 +10,4 @@
*
* The TYPO3 project - inspiring people to share!
*/
define(["require","exports","TYPO3/CMS/Backend/Enum/Severity","jquery","TYPO3/CMS/Backend/Modal"],(function(e,a,t,n,i){"use strict";return new class{constructor(){this.initialize()}initialize(){n(".t3js-submit-file-rename").on("click",this.checkForDuplicate)}checkForDuplicate(e){e.preventDefault();const a=n("#"+n(e.currentTarget).attr("form")),r=a.find('input[name="data[rename][0][target]"]'),l=a.find('input[name="data[rename][0][conflictMode]"]'),c=TYPO3.settings.ajaxUrls.file_exists;n.ajax({cache:!1,data:{fileName:r.val(),fileTarget:a.find('input[name="data[rename][0][destination]"]').val()},success:e=>{const n=void 0!==e.uid,c=r.data("original"),s=r.val();if(n&&c!==s){const e=TYPO3.lang["file_rename.exists.description"].replace("{0}",c).replace("{1}",s);i.confirm(TYPO3.lang["file_rename.exists.title"],e,t.SeverityEnum.warning,[{active:!0,btnClass:"btn-default",name:"cancel",text:TYPO3.lang["file_rename.actions.cancel"]},{btnClass:"btn-primary",name:"rename",text:TYPO3.lang["file_rename.actions.rename"]},{btnClass:"btn-default",name:"replace",text:TYPO3.lang["file_rename.actions.override"]}]).on("button.clicked",e=>{"cancel"!==e.target.name&&(l.val(e.target.name),a.submit()),i.dismiss()})}else a.submit()},url:c})}}}));
\ No newline at end of file
define(["require","exports","TYPO3/CMS/Backend/Enum/Severity","jquery","TYPO3/CMS/Backend/Modal"],(function(e,a,t,n,i){"use strict";return new class{constructor(){this.initialize()}initialize(){n(".t3js-submit-file-rename").on("click",this.checkForDuplicate)}checkForDuplicate(e){e.preventDefault();const a=n("#"+n(e.currentTarget).attr("form")),r=a.find('input[name="data[rename][0][target]"]'),l=a.find('input[name="data[rename][0][conflictMode]"]'),c=TYPO3.settings.ajaxUrls.file_exists;n.ajax({cache:!1,data:{fileName:r.val(),fileTarget:a.find('input[name="data[rename][0][destination]"]').val()},success:e=>{const n=void 0!==e.uid,c=r.data("original"),s=r.val();if(n&&c!==s){const e=TYPO3.lang["file_rename.exists.description"].replace("{0}",c).replace(/\{1\}/g,s);i.confirm(TYPO3.lang["file_rename.exists.title"],e,t.SeverityEnum.warning,[{active:!0,btnClass:"btn-default",name:"cancel",text:TYPO3.lang["file_rename.actions.cancel"]},{btnClass:"btn-primary",name:"rename",text:TYPO3.lang["file_rename.actions.rename"]},{btnClass:"btn-default",name:"replace",text:TYPO3.lang["file_rename.actions.override"]}]).on("button.clicked",e=>{"cancel"!==e.target.name&&(l.val(e.target.name),a.submit()),i.dismiss()})}else a.submit()},url:c})}}}));
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment