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.
Problem/Motivation
The chosen 4.0.0-rc1 drush command chosenplugin doesn't work correctly. In the status report,
Chosen JavaScript file
Not installed
You need to download the Chosen JavaScript file and extract the entire contents of the archive into the libraries/chosen directory in your Drupal installation directory.
after a the drush command and informations,
sudo drush chosenplugin
[notice] The file 2.2.1 was not deleted because it does not exist.
[notice] A existing Chosen plugin was deleted from libraries
[success] Chosen plugin has been installed in libraries
After the chosen drush command in web/libraries/chosen
there is a subfolder chosen-2.2.1
.
Steps to reproduce
Proposed resolution
In file chosen/modules/chosen_lib/src/Commands/ChosenLibCommands.php a change like,
if ('chosen' !== $dirname) {
$this->drush_move_dir($dirname, 'chosen');
$dirname = 'chosen';
}
to
if ('chosen' !== $dirname) {
$subdirname = $dirname . '/chosen-' . $dirname;
if (is_dir($subdirname)) {
$this->drush_move_dir($subdirname, 'chosen');
$fileservice = \Drupal::service('file_system');
$fileservice->deleteRecursive($dirname);
} else {
$this->drush_move_dir($dirname, 'chosen');
}
$dirname = 'chosen';
}
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#2 | fix-plugin-download-3335931-2.patch | 4.31 KB | nagy.balint |
Comments
Comment #2
nagy.balint CreditAttribution: nagy.balint at Webbtik.io commentedWe can also remove the old drush plugin which is not used anymore.
Comment #3
nagy.balint CreditAttribution: nagy.balint at Webbtik.io commentedComment #4
Chris64The patch could be applied. The chosen drush command chosenplugin works, with message,
Chosen configuration page is accessible. The status report includes suitable information,
Chosen JavaScript file Installed
No files .inc exist any more in the chosen module. That's alright now.
Comment #6
nagy.balint CreditAttribution: nagy.balint at Webbtik.io commentedThanks!