Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello,
in my template.php I use a hook for replace the field files with Plupload form in my node form :
function MyTheme_form_folder_node_form_alter(&$form, &$form_state) {
$form['field_files'] = array(
'#type' => 'plupload',
'#title' => t('Upload files'),
'#description' => t('This multi-upload widget uses Plupload library.'),
);
}
But if I upload files and save the node, files aren't saved in site and I get this error :
Notice : Undefined index: #language in locale_field_entity_form_submit() (line 438 in /home/www/mysite.com/modules/locale/locale.module).
I made a mistake? The hook code is not good?
Thanks for your help.
Comments
Comment #1
kumkum29 CreditAttribution: kumkum29 commentedMy problem may be related to this subject: https://drupal.org/node/2069179
Infos : I use Drupal 7.23
Comment #2
slashrsm CreditAttribution: slashrsm commentedYour problem is most likely not related to that issue. You shouldn't write this kind of code in template.php. Write modules instead.
Plupload is a bit different than core's managed_file element, since it handles files a bit differently. It is definitely not enough to just replace core's form element with upload. Check modules that implement Plupload (Media, FileField sources Plupload, ...) how it is done there.
Comment #3
kumkum29 CreditAttribution: kumkum29 commentedThanks slashrsm.
with filefieldsource + filefieldsource plupload i get pluload form on my field file.
It's ok.
Thanks a lot.