Skip to content
Snippets Groups Projects
Commit f7042c95 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #41385 by Thox: made the upload.module work again.

parent 77130e7a
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -12,7 +12,8 @@ function uploadAutoAttach() { ...@@ -12,7 +12,8 @@ function uploadAutoAttach() {
for (i = 0; input = inputs[i]; i++) { for (i = 0; input = inputs[i]; i++) {
if (input && hasClass(input, 'upload')) { if (input && hasClass(input, 'upload')) {
var uri = input.value; var uri = input.value;
var button = input.id.substr(5); // Extract the button ID based on a subtring of the input name: edit[foo][bar] -> foo-bar
var button = input.name.substr(5, input.name.length - 6).replace('][', '-');
var wrapper = button + '-wrapper'; var wrapper = button + '-wrapper';
var hide = button + '-hide'; var hide = button + '-hide';
var upload = new jsUpload(uri, button, wrapper, hide); var upload = new jsUpload(uri, button, wrapper, hide);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment