Hi Drupalers,

I installed Multiselect 7.x.1.9 and work nice, but when replace o update to 7.x.1.10 has problems. Js doesn't working.

I had to install improve multiselect and uninstall Multiselect.

Comments

xlyz’s picture

same problem here. still investigating, but it seems that it does not add multiselect.js to the page

xlyz’s picture

Priority: Normal » Critical

it looks like that hook_field_widget_form() does not works when the form is built in code.

a quick workaround is adding js and css directly in your code,

  $module_path = drupal_get_path('module', 'multiselect');
  $form['#attached'] = array(
   'css' => array($module_path . '/multiselect.css'),
   'js' => array($module_path . '/multiselect.js'),
  );

but need some test to see if this fix everything or there are other problems

fgjohnson@lojoh.ca’s picture

I installed the previous version (7.x-1.9), and this module still fails.
Is there a fix in the works for this?

Where does that code go and I'll install and test...

fgjohnson@lojoh.ca’s picture

Try using an updated version of php
:-)

Nick Robillard’s picture

I am also seeing this issue in 7.x-1.13 where hook_field_widget_form in multiselect module is never called. I would like to point out that the "fix" in #2 is not a fix at all. Even though the JS and CSS is added, other important logic is still missing - like support for #required and also the ability to remove all selections (if I remove all selections and save, the original selections remain unchanged).

I am using PHP 5.6 which is supported by Drupal 7 (minimum is 5.4). I don't think upgrading to a newer version of PHP is a reasonable solution. @fgjohnson do you know what exactly a newer version of PHP is solving?

DamienMcKenna’s picture

Assigned: gmangones » Unassigned
Issue tags: -multiselect

FYI the "assigned" field is for indicating that you're currently working on an issue, once you've completed your work (or aren't intending to work on it) you should change it to "unassigned".