- πΊπΈUnited States bamberjp
Revised 7.x-2.x patch attached.
idspecified in#attributesnot taken into account inplupload_element_pre_render().
This one got me for a bit.
plupload_element_info() specifies:
$types = array();
$module_path = drupal_get_path('module', 'plupload');
$types['plupload'] = array(
'#input' => TRUE,
'#attributes' => array('class' => array('plupload-element')),
// @todo
// '#element_validate' => array('file_managed_file_validate'),
'#theme_wrappers' => array('form_element'),
'#theme' => 'container',
'#value_callback' => 'plupload_element_value',
'#attached' => array(
'library' => array(array('plupload', 'plupload')),
'js' => array($module_path . '/plupload.js'),
'css' => array($module_path . '/plupload.css'),
),
'#process' => array('plupload_element_process'),
'#element_validate' => array('plupload_element_validate'),
'#pre_render' => array('plupload_element_pre_render'),
);
return $types;
Note the #attributes key.
If the implementation ALSO specifies that key, e.g.:
// Upload section.
"upload" => array(
'#type' => 'plupload',
'#title' => t('Add Documents'),
'#description' => t('Drag and drop files here'),
'#plupload_settings' => array(
'runtimes' => 'html5',
'chunk_size' => '1mb',
),
'#attributes' => array(
'class' => array("js-my-class"),
),
),
then the JavaScript won't be able to find the form elements and will fail.
Workaround is easy β manually include the plupload-element class:
'#attributes' => array('class' => array('js-my-class', 'pl-upload-element')),
But it would be nice if one of the element processing hooks took care of this, as most others do.
Active
2.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Revised 7.x-2.x patch attached. id specified in #attributes not taken into account in plupload_element_pre_render().