After installing Chosen jQuery plugin under sites/all/libraries/chosen this error shows up at admin/config/user-interface/chosen:

The library could not be detected. You need to download the !chosen and extract the entire contents of the archive into the libraries directory on your server.

After installing Libraries API this error disappears and everything works fine. So dependency to Libraries API should be added to info file.

Comments

geraldito created an issue. See original summary.

aadil.addweb’s picture

You need to put "Chosen" jQuery plugin under libraries/chosen folder instead of sites/all/libraries/chosen in Drupal 8.
There is no need to add dependency of "Libraries API" in info file.

geraldito’s picture

Thanks, that worked.

Actually it's described like that in README. But maybe it would be nice to add the D8 path to project page as there it only mentions sites/all/libraries in step 1 of installation.

nagy.balint’s picture

Status: Active » Fixed

Done.

tkoleary’s picture

The more salient fact at this point is there is no 'libraries' in Drupal 8, only 'vendor' so you cant 'extract the archive under libraries' because you need to create the libraries directory.

Should probably be changed to recognize the library if it's in /Vendor.

Status: Fixed » Closed (fixed)

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

rli’s picture

Category: Bug report » Task

The thing is, chosen should be leveraging from libraries API module to avoid other module's duplication and have the site managing libraries in a better form. Current d8 has external libraries stored in /libraries is not ideal for us. I.E. we have a real URL for all the libraries in the state in `/libraries`, this will lead to a conflict. Libraries API has a sound solution.

nagy.balint’s picture

@rli: I agree that eventually we should use the libraries API, or maybe drupal core will be extended to do something similar.

But for now the libraries module on drupal 8 does not have any release at all. I think we should not depend on a development version, when this module itself is stable.

The current code in _chosen_lib_get_chosen_path actually searches in three locations, so the library can be elsewhere as well.
And of course that function could be extended in the future. But anyways its just a workaround for now.