Commit 550caaa3 authored by Anybody's avatar Anybody Committed by jungle

Issue #2977463 by Anybody, jungle, esolitos, jcnventura: Allow configuration...

Issue #2977463 by Anybody, jungle, esolitos, jcnventura: Allow configuration of dropzonejs timeout, default value causes silent errors
parent 4401cf28
tmp_upload_scheme: temporary
filename_transliteration: true
upload_timeout_ms: 0
......@@ -8,3 +8,6 @@ dropzonejs.settings:
filename_transliteration:
type: boolean
label: 'Transliterate names of uploaded files'
upload_timeout_ms:
type: integer
label: 'Upload timeout'
......@@ -72,3 +72,14 @@ function dropzonejs_update_8002() {
$config->set('filename_transliteration', TRUE);
$config->save(TRUE);
}
/**
* Set default value for upload timeout.
*/
function dropzonejs_update_8003() {
$config_factory = \Drupal::configFactory();
$config = $config_factory->getEditable('dropzonejs.settings');
$config->clear('upload_timeout_ms');
$config->set('upload_timeout_ms', 0);
$config->save(TRUE);
}
......@@ -138,6 +138,7 @@ class DropzoneJs extends FormElement {
'dictDefaultMessage' => Html::escape($element['#dropzone_description']),
'acceptedFiles' => '.' . str_replace(' ', ',.', self::getValidExtensions($element)),
'maxFiles' => $element['#max_files'],
'timeout' => \Drupal::configFactory()->get('dropzonejs.settings')->get('upload_timeout_ms'),
],
],
];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment