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.
I'm not too hot at Javascript
Was surprised to find this error in my page
Uncaught TypeError: select.oldChosen is not a function
from chosen.js:24
var ret = select.oldChosen(options);
Composer believes everything is up to date.
Issue fork chosen-3348967
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
arunkumarkSeems the library is not installed for the Chosen module. Follow the below step to resolve the JS uncaught issue.
Manual Installation
1. Download the Chosen jQuery plugin.
2. [Drupal 7] Extract the plugin under sites/all/libraries
3. [Drupal 9-10] Extract the plugin under libraries/chosen. Use version 1.5 or higher.
4. Download and enable the module.
5. Configure at Administer > Configuration > User interface > Chosen (requires administer site configuration permission)
Installation via Drush
A Drush command is provided in the latest versions for easy installation of the Chosen plugin.
drush chosenplugin
The command will download the plugin and unpack it in "sites/all/libraries".
It is possible to add another path as an option to the command, but not
recommended unless you know what you are doing.
Comment #3
matslats CreditAttribution: matslats as a volunteer commentedThanks I didn't realise the js library was not installed.
I can install chosen via drush
I'm not sure if this operation applies to individual sites or to a whole platform.
The 'chosenplugin' command completes without giving any details.
Because I am installing and running many similar sites on the same platform, I need this operation fully automated, either by a line in the installation profile (if it is required per site) or via composer (it is required per platform)
Can you advise further?
Thanks?
Comment #4
thejimbirch CreditAttribution: thejimbirch at Kanopi Studios commentedIf you are using a Continuous Integration (CI) process to deploy, you can add the
drush chosenplugin
command there.For example, in a CI script that connects to Pantheon, we added the following command after config import, before cache-rebuild.