From 639cc0222cf670df2355fb10332313e618738b7a Mon Sep 17 00:00:00 2001 From: Loz Calver Date: Wed, 12 Dec 2012 15:55:33 +0000 Subject: [PATCH] BUG Fix insert media form inserting images from other UploadFields (fixes #8051) The insert media form would pick up unwanted images from other UploadFields. Limiting where it is looking to only the closest form fixes this. --- javascript/HtmlEditorField.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript/HtmlEditorField.js b/javascript/HtmlEditorField.js index d33afd4c5..656527fe0 100644 --- a/javascript/HtmlEditorField.js +++ b/javascript/HtmlEditorField.js @@ -874,7 +874,7 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE; //get the uploaded file ID when this event triggers, signaling the upload has compeleted successfully editFieldIDs.push($(this).data('id')); }); - var uploadedFiles = $('.ss-uploadfield-files').children('.ss-uploadfield-item'); + var uploadedFiles = form.find('.ss-uploadfield-files').children('.ss-uploadfield-item'); uploadedFiles.each(function(){ var uploadedID = $(this).data('fileid'); if ($.inArray(uploadedID, editFieldIDs) == -1) {