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

kumkum29’s picture

My problem may be related to this subject: https://drupal.org/node/2069179

Infos : I use Drupal 7.23

slashrsm’s picture

Category: bug » support
Priority: Major » Normal
Status: Active » Closed (works as designed)

Your 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.

kumkum29’s picture

Status: Closed (works as designed) » Fixed

Thanks slashrsm.

with filefieldsource + filefieldsource plupload i get pluload form on my field file.

It's ok.
Thanks a lot.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.