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 commentedWe can also remove the old drush plugin which is not used anymore.
Comment #3
nagy.balint 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 InstalledNo files .inc exist any more in the chosen module. That's alright now.
Comment #6
nagy.balint commentedThanks!