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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Chris64 created an issue. See original summary.

nagy.balint’s picture

We can also remove the old drush plugin which is not used anymore.

nagy.balint’s picture

Status: Active » Needs review
Chris64’s picture

Status: Needs review » Reviewed & tested by the community

The patch could be applied. The chosen drush command chosenplugin works, with message,

 [notice] A existing Chosen plugin was deleted from libraries
 [success] Chosen plugin has been installed in libraries

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.

  • nagy.balint committed 3f107e19 on 4.0.x
    Issue #3335931 by nagy.balint, Chris64: Drush command chosenplugin does...
nagy.balint’s picture

Status: Reviewed & tested by the community » Fixed

Thanks!

Status: Fixed » Closed (fixed)

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