Hello, I'm trying this module, but on my installation works only the "Simple HTML Select" option, If I try to enable MARGHOOB or CHOSEN the site stops loading javascript and css .

I've installed the libraries in:

  • siteroot/libraries/ms-dropdown
  • siteroot/libraries/chosen

I've also installed the libraries module for drupal 8.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Skin created an issue. See original summary.

Skin’s picture

Issue summary: View changes
Znak’s picture

You need the library in folder /sites/all/libraries/library_name

Skin’s picture

I've tried to put ms-Dropdown in /sites/all/libraries/ms-Dropdown but the result is the same, when I load the site it is an html page without css and javascript, a simple white page with text and links; if I disable the block everything start to work again.

Thanks for the reply.

Skin’s picture

P.S. in the error log I have no entries

But there is something in the apace error log:

Thu Jan 05 12:14:20.438129 2017] [:error] [pid 9220] [client 127.0.0.1:41870] PHP Fatal error: Call to undefined function Drupal\\lang_dropdown\\Form\\drupal_add_css() in /home/alessio/public_html/apicolturamasini/modules/lang_dropdown/src/Form/LanguageDropdownForm.php on line 172, referer: http://localhost/apicolturamasini/it/admin/structure/block/manage/langua...

shaisamuel’s picture

Installed the ms-Dropdown in /sites/all/libraries/ms-Dropdown, and set the output type to: "Marghood Duleman Dropdown jquery library"
I got error in my error_log:

PHP Fatal error:  Call to undefined function Drupal\lang_dropdown\Form\drupal_add_css() in public_html/modules/lang_dropdown/src/Form/LanguageDropdownForm.php on line 172

Using version 8.x-2.x-dev (2016-Dec-25), and D8 8.2.5

shaisamuel’s picture

I think I found the issue why nothing except Simple HTML is displayed.

It has to do with the drupal_add_css() calls in LanguageDropdownForm.php (4 calls). D8 doesn't use drupal_add_css anymore. It is all explained in:
https://www.drupal.org/docs/8/creating-custom-modules/adding-stylesheets-css-and-javascript-js-to-a-drupal-8-module

Unfortunately I don't have enough Drupal understanding to be able to fix it.

myLies’s picture

Assigned: Unassigned » myLies
myLies’s picture

well, it was hard but I done it
fixed wrong library path(currently it should placed in drupal_root/libraries/ - sites/all/libraries it's more for drupal 7)
replaced deprecated functions drupal_add_js\drupal_add_css

for now it should work with other output type and display formats

myLies’s picture

Status: Active » Needs review
Skin’s picture

I've applied the patch and now it works, thanks.

There is still some work to do, for example if the library is not present there is no error message and the site load the default simple html library.

@myLies I received the notification regarding your personal message, but apparently I dont have the permission to use the contact form on this site, if I try to use the contact form I have a 403 access denied

myLies’s picture

changed validation for exist libraries
@Skin - my fault, I fixed my profile configs, so if you wanna discuss something - you are welcome)

kala4ek’s picture

Assigned: myLies » kala4ek

  • kala4ek committed 79beab1 on 8.x-2.x authored by myLies
    Issue #2840291 by myLies, Skin, shaisamuel, kala4ek: Works only with...
kala4ek’s picture

Assigned: kala4ek » Unassigned
Status: Needs review » Fixed

Thanks all for working on this issue.
Committed to dev version.

There is still some work to do, for example if the library is not present there is no error message and the site load the default simple html library.

Let's other issues create as new one.

Status: Fixed » Closed (fixed)

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