From 121bd92263e1ae3773a52e2125b94a6d5d31747e Mon Sep 17 00:00:00 2001 From: CamilleBeau Date: Thu, 28 Mar 2024 10:37:38 -0400 Subject: [PATCH 1/3] [Publication] Fix deletion of file when editing project --- CHANGELOG.md | 1 + modules/publication/jsx/projectFields.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91346b860b7..e7c462fa6a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ changes in the following format: PR #1234*** - Fix examiner site display (PR #8967) - bvl_feedback updates in real-time (PR #8966) - DoB and DoD format respected in candidate parameters (PR #9001) +- Fix delete file in upload (PR #TODO) ## LORIS 25.0 (Release Date: ????-??-??) ### Core diff --git a/modules/publication/jsx/projectFields.js b/modules/publication/jsx/projectFields.js index f7ed8569418..304b9df6ca3 100644 --- a/modules/publication/jsx/projectFields.js +++ b/modules/publication/jsx/projectFields.js @@ -182,7 +182,7 @@ class ProjectFormFields extends React.Component { console.error(error); }); } - }); + }.bind(this)); } /** From 922ffb4e47fc73db6d9e6886983780da50971dac Mon Sep 17 00:00:00 2001 From: CamilleBeau Date: Thu, 28 Mar 2024 10:41:45 -0400 Subject: [PATCH 2/3] add to changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7c462fa6a2..2f26581f374 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,7 @@ changes in the following format: PR #1234*** - Fix examiner site display (PR #8967) - bvl_feedback updates in real-time (PR #8966) - DoB and DoD format respected in candidate parameters (PR #9001) -- Fix delete file in upload (PR #TODO) +- Fix delete file in upload (PR #9181) ## LORIS 25.0 (Release Date: ????-??-??) ### Core From cffd097a88e7ae11458a90a3b4de7c4a93b1d409 Mon Sep 17 00:00:00 2001 From: CamilleBeau Date: Thu, 28 Mar 2024 10:54:58 -0400 Subject: [PATCH 3/3] fix file deletion cancel --- modules/publication/jsx/projectFields.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/publication/jsx/projectFields.js b/modules/publication/jsx/projectFields.js index 304b9df6ca3..2f99ce20dc6 100644 --- a/modules/publication/jsx/projectFields.js +++ b/modules/publication/jsx/projectFields.js @@ -163,8 +163,8 @@ class ProjectFormFields extends React.Component { showCancelButton: true, confirmButtonText: 'Yes, I am sure!', cancelButtonText: 'No, cancel it!', - }).then(function(willDelete) { - if (willDelete) { + }).then((result) => { + if (result.value) { let url = loris.BaseURL + '/publication/ajax/FileDelete.php?uploadID=' + uploadID; @@ -182,7 +182,7 @@ class ProjectFormFields extends React.Component { console.error(error); }); } - }.bind(this)); + }); } /**