3

Guess I found a bug here and already filed it:

  • Created custom profile,
  • added https://www.drupal.org/project/mmenu dependency (which then is placed under profiles/profile_name/modules/contrib/mmenu).
  • Added MMenu libraries (jquery.mmenu, hammer.js, jquery.hammer),
  • activated everything but then Drupal looks for the wrong library paths under libraries/mmenu instead of profiles/profile_name/libraries/mmenu.

libraries_get_path('mmenu') returns correct path (profiles/profile_name/libraries/mmenu).

drupal_get_profile() returns correct profile.

Drupal seems to only take the paths defined in mmenu.libraries.yml into account. Changing them makes everything work as desired. So, I'm asking myself now: Is there any possibility to override the paths defined in mmenu.libraries.yml from a custom module?

5

Yes, this is possible, there is a hook that can be used to alter libraries called: hook_library_info_alter.

You can use this to alter basically anything is the library definition.

  • 2
    To expand on that, libraries_get_path() is from the libraries module. It is weird, but it has absolutely nothing to do with libraries.yml files, which are a core feature. To make this work, you you ned to check the path and dynamically set it for your library definition, look at jw_player, dropzonejs and other examples. – Berdir Aug 9 '16 at 19:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.