- πΊπΈUnited States smustgrave
If still a valid bug please reopen updating issue summary for D10 and up.
Thanks!
Setting to 8.4.x because someone will anyway, but I don't know if this applies to Drupal 8.
Using the file_managed
element type with the form API, and using the #upload_validators
FAPI property with file_validate_extensions
, after selecting a file from the local file system for upload, the console emits
TypeError: this.value is undefined
.
validateExtension()
is being attached to the <div>
that contains the <input>
's. The div has no value attribue. I think file_managed_file_process()
is the function that sets Drupal.settings.file. The file behavior iterates over Drupal.settings.file.
To repoduce you can use this module and go to /admin/custom:
function hook_menu() {
$items['admin/custom'] = array(
"title" => "Blah",
"page callback" => "drupal_get_form",
"page arguments" => array("blah_form"),
);
return $items;
}
function blah_form($form, $form_state) {
$form['file'] = array(
'#type' => 'managed_file',
'#upload_validators' => array(
'file_validate_extensions' => array(
'xml'
),
),
);
return $form;
}
Closed: outdated
11.0 π₯
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
If still a valid bug please reopen updating issue summary for D10 and up.
Thanks!