From 0b859070f0dc2257c2d2356c8861906c3ef5ca72 Mon Sep 17 00:00:00 2001 From: indigoxela Date: Wed, 27 Apr 2022 04:22:34 +0200 Subject: [PATCH] Issue #4284: Fix auto-upload with multiple file fields on the same form. By @indigoxela, @stpaultim, @kswan, and @argiepiano. --- core/modules/file/js/file.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/core/modules/file/js/file.js b/core/modules/file/js/file.js index a4c016dabbb..bbca96b253c 100644 --- a/core/modules/file/js/file.js +++ b/core/modules/file/js/file.js @@ -19,10 +19,6 @@ Backdrop.behaviors.fileUploadChange = { $(context).find('input[data-file-auto-upload]').once('auto-upload').on('change', Backdrop.file.autoUpload).each(function() { $(this).closest('.form-item').find('.file-upload-button').hide(); }); - }, - detach: function (context, settings) { - $(context).find('input[data-file-extensions]').off('change', Backdrop.file.validateExtension); - $(context).find('input[data-file-auto-upload]').off('change', Backdrop.file.autoUpload); } }; @@ -33,10 +29,6 @@ Backdrop.behaviors.fileButtons = { attach: function (context) { $('input.form-submit', context).once('file-disable-fields').bind('mousedown', Backdrop.file.disableFields); $('div.form-managed-file input.form-submit', context).once('file-progress-bar').bind('mousedown', Backdrop.file.progressBar); - }, - detach: function (context) { - $('input.form-submit', context).unbind('mousedown', Backdrop.file.disableFields); - $('div.form-managed-file input.form-submit', context).unbind('mousedown', Backdrop.file.progressBar); } };