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.
But sites\all\libraries\modernizr\modernizr.min.js
contains the version header:
/* Modernizr 2.6.2 (Custom Build) | MIT & BSD
* Build: http://modernizr.com/download/#-inputtypes-svg-touch-cssclasses-addtest-teststyles-prefixes-elem_details
*/
Comments
Comment #1
hass CreditAttribution: hass commentedAfter I have added the non-minified version to the same folder and the error disappeared. This means the pattern seems not checked if there is no "source" variant and only the "min" file.
Also re-tested with latest Modernizr 2.7.1 and see the same behavior. Looks like library definitions are not correct.
Comment #2
tcowin CreditAttribution: tcowin commentedI found that Modernizr appears to have added a v in front of the version number - at least in version 2.7.0. (Modernizr v2.7.0).
Adding a v? into the regex of the version_arguments appears to correct it:
'pattern' => '/Modernizr\s*v?([\d\.]+)/',
line 952 of navbar.module
Comment #3
jessebeach CreditAttribution: jessebeach commentedThat's right. Libraries requires that I point to one particular file to do that version checking.
tcowin, I added the
v
to the regex, nice catch.Committed in be852256.
Comment #4
mrfelton CreditAttribution: mrfelton commentedThis isn't working right according to the documentation which says to download the js and add to sites/all/libraries/modernizr/modernizr.min.js. The only way I could get this working was to also download a non-minified version of the library and add to sites/all/libraries/modernizr/modernizr.js
Comment #5
jessebeach CreditAttribution: jessebeach commentedI've updated the documentation.
https://drupal.org/project/navbar
Is this sufficient?
Comment #6
Wim LeersLibraries API can only detect versions on the non-minified file. So if you want to use the minified Backbone/Underscore/Modernizr, you must either download both the unminified (backbone.js) and the minified (backbone-min.js), or only download the minified and rename it to backbone.js. Otherwise Libraries API will fail.
Comment #7
Wim Leers#2167021: Revamp Libraries API integration fixes the code.
Comment #8
sibiru CreditAttribution: sibiru commentedI got issue modernizr not detected
The documentation https://drupal.org/node/1993254 said
.."A preconfigured version of the modernizr library, renamed to be available as sites/all/libraries/modernizr/modernizr.min.js"
But the correct one is in project page https://drupal.org/project/navbar
.."The file should be named modernizr-min.js"
Please update this dependency issue..
please consider to require this project
https://drupal.org/project/modernizr
in that project uses filename "modernizr.min.js"
Comment #9
hass CreditAttribution: hass commentedLooks like the incorrect reference to modernizr.min.js has been fixed everywhere in the module.
Comment #10
Tommy Kaneko CreditAttribution: Tommy Kaneko as a volunteer commentedLatest version of Modernizr has lowercase 'modernizr' in the js header, which the regex should try to catch if the status report is to avoid reporting that the file cannot be found.
Comment #11
rootwork@Tommy Kaneko I've created a separate issue to try to get this more attention, since it's a discrete issue from the original report here and this issue is already closed. #2628978: Modernizr now uses lowercase 'm' in js header; regex check for file needs to be updated