diff --git a/CHANGES.md b/CHANGES.md
index bad6369702..3dce5727e0 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -1,4 +1,5 @@
# 7.1.7 2025-xx-xx
+ - 2025-02-21 Fixed Core.UI.js bugs - AttachmentExist is only generated for one upload field. However, it should be generated for all of them. In addition, the UploadField is not selected correctly.
- 2025-02-21 Fixed broken documentation link in ACL Edit Screen and changed text of hint.
# 7.1.6 2025-02-19
diff --git a/var/httpd/htdocs/js/Core.UI.js b/var/httpd/htdocs/js/Core.UI.js
index 203898f883..113197bb5e 100644
--- a/var/httpd/htdocs/js/Core.UI.js
+++ b/var/httpd/htdocs/js/Core.UI.js
@@ -522,6 +522,7 @@ Core.UI = (function (TargetNS) {
var $ContainerObj = $DropObj.closest('.Field'),
$FileuploadFieldObj = $ContainerObj.find('.AjaxDnDUpload'),
+ FieldID = $FileuploadFieldObj.attr('id'),
FormID = $FileuploadFieldObj.data('form-id') ? $FileuploadFieldObj.data('form-id') : $DropObj.closest('form').find('input[name=FormID]').val(),
ChallengeToken = $DropObj.closest('form').find('input[name=ChallengeToken]').val(),
IsMultiple = ($FileuploadFieldObj.attr('multiple') == 'multiple'),
@@ -744,8 +745,9 @@ Core.UI = (function (TargetNS) {
}
// Append input field for validation (see bug#13081).
- if (!$('#AttachmentExists').length) {
- $('.AttachmentListContainer').append('');
+ // Add the FieldID to the input field value to make it easier to identify the upload field, which gets a new file.
+ if (!$ContainerObj.find('.AttachmentListContainer').find('#AttachmentExists').length) {
+ $ContainerObj.find('.AttachmentListContainer').append('');
}
});
@@ -755,7 +757,6 @@ Core.UI = (function (TargetNS) {
$DropObj.removeClass('Uploading');
},
error: function() {
- // TODO: show an error tooltip?
$DropObj.removeClass('Uploading');
}
});
@@ -836,7 +837,7 @@ Core.UI = (function (TargetNS) {
var $TriggerObj = $(this),
$AttachmentListContainerObj = $TriggerObj.closest('.AttachmentListContainer'),
- $UploadFieldObj = $AttachmentListContainerObj.next('.AjaxDnDUpload'),
+ $UploadFieldObj = $AttachmentListContainerObj.nextAll('.AjaxDnDUpload'),
FormID = $UploadFieldObj.data('form-id') ? $UploadFieldObj.data('form-id') : $(this).closest('form').find('input[name=FormID]').val(),
Data = {
Action: $(this).data('delete-action') ? $(this).data('delete-action') : 'AjaxAttachment',