Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I may be missing something but the location of the minified js and css files look like that have changes with the release of mmenu 6.0.0 from. Patch attached to update hook_libraries_info()
from:
/dist/js/jquery.mmenu.all.min.js
/dist/js/jquery.mmenu.all.min.css
to:
/dist/jquery.mmenu.all.min.js
/dist/jquery.mmenu.all.min.css
Comment | File | Size | Author |
---|---|---|---|
#21 | responsive_menu-mmenu-path-changes-21.patch | 841 bytes | grshane |
#18 | mmenu_file_path_changes-2867087-18-D7.patch | 486 bytes | anrikun |
#8 | responsive_menu-mmenu_evolution-2867087-8.patch | 939 bytes | Grimreaper |
#6 | mmenu_min_file_location_change-2867087-6.patch | 1.25 KB | bigjim |
#5 | mmenu_min_file_location_change-2867087-5.patch | 771 bytes | bigjim |
Comments
Comment #2
tancThanks for the report, I'll look into it. We'll probably need to support both paths for backwards compatibility, or require everyone updates to version 6 of the mmenu library.
Comment #3
bigjim CreditAttribution: bigjim commentedNo problem, here's the mmenu commit that makes the change
https://github.com/FrDH/jQuery.mmenu/commit/28cdf6d0724f6ce983423185de22...
Comment #4
tancComment #5
bigjim CreditAttribution: bigjim commentedI think something like this would do it, I'm not sure if the versions element in hook_libraries_info() will cover all previous versions?
So does it need one element in the version array for every minor release or will declaring 5.7 cover 5.7.x and before? Or do you need individual declarations for each minor release5.7.8, 5.7.7, 5.7.6 etc...
Comment #6
bigjim CreditAttribution: bigjim commentedOkay found a comment in the API docs that clarifies the versioning issue I raised in #5 above.
As an added bonus, versions pervious to 5.6 have a different file name for the minified js (jquery.mmenu.min.all.js). Also, versions 5.4 & 5.5 move the files into js and css sub-folders of the /dist/core folder. Those same files are in /dist for version 5.0 - 5.3, I didn't put anything in here to support 4.x releases of mmenu.
Patch added here.
Comment #7
tancGreat! Thanks for the patch, I'll try and review asap
Comment #8
GrimreaperHello,
Same problem on the Drupal 8 version.
I wanted to test the module and so I downloaded the last version of mmenu, 6.1.0.
Here is a patch for the Drupal 8 version.
Comment #9
dhumed CreditAttribution: dhumed commented^ Does the responsive menu work with the patch? I'm wanting to implement this menu on a personal site.
Comment #10
tancCan you please test it and report back?
Comment #11
dhumed CreditAttribution: dhumed as a volunteer commentedI've tested the patch from Grimreaper and can confirm that the module now works for Drupal 8. Exact steps that I followed:
curl https://www.drupal.org/files/issues/responsive_menu-mmenu_evolution-2867087-8.patch | patch -p1
Comment #12
tancExcellent! Thank you for testing. I'm going to mark this as RTBC and switch to 8.x for now. Then we can switch back to 7.x and test that other patch.
My only concern with committing this patch is that it will break backwards compatibility with currently installed versions of mmenu which are prior to 6.x.x. I'm not sure how to tackle that at the moment. Any ideas?
Comment #13
GrimreaperHello,
For backwards compatibility, here is a suggestion.
Maybe declaring two Drupal libraries, one for < 6.0.0 and one for > 6.0.0.
Adding a check if a certain file is installed or parsing one of the .json files at the root of the library as its have the library version, and then adding the appropriate Drupal library.
Comment #14
tancThat was about my line of thinking too. I guess we'd have config that would be set once the settings page was saved that would set the library version (via a file check as you mentioned). The setting could be hidden from the form so it would be transparent to the user. This way there is single file check when viewing/saving the form avoiding doing it every page load.
Comment #15
dpacassiI can confirm that #8 works great with mmenu 6.1.0
Comment #16
tancAs an added complication, the 6.x version that is downloaded from the mmenu site has a different file layout. This is the layout that you get if you run the new task runner to compile just the files you need. So its getting a bit complicated and we'll either have to direct people to download a github release and detect the file layout for 5.x and 6.x versions, or we try to cover all permutations including compiled versions. Needs more thought.
Comment #17
milopca CreditAttribution: milopca commented#8 also works fine for me. Thanks!
Comment #18
anrikun CreditAttribution: anrikun commentedSame patch as #8 for D7
Comment #20
anrikun CreditAttribution: anrikun commentedComment #21
grshane CreditAttribution: grshane commentedThe latest version of mmenu gets downloaded into libraries/jquery.mmenu not libraries/mmenu. #8 now no longer works. Hammer.js has a similar issue it is downloaded into libraries/hammer.js not libraries/hammerjs.
If it makes any difference, I am adding the libraries via composer and custom repositories for each library.
Comment #22
tancThis has always been the case grshane, you will need to rename your libraries after you have downloaded. You can also do this in your composer.json by specifying the path and name in the
extra
section ininstaller-paths
. For example for masonry I do this:If I didn't do that then masonry would expand to a folder called
masonry-3.3.2
I'll try and write a more complete example for the libraries this module uses soon but hopefully that should get you started.
Comment #23
tancThanks @anrikun, the patch looks good. I'll need to test then will commit. I also have some other backport work to do on the D7 branch from other issues so a release might not be imminent but hopefully quite soon.
Comment #25
tancOk folks, I think we're good! Thanks for everyones help, I'm going to close this issue