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

hass’s picture

Priority: Critical » Normal

After 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.

tcowin’s picture

I 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

jessebeach’s picture

Status: Active » Fixed

This means the pattern seems not checked if there is no "source" variant and only the "min" file.

That'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.

mrfelton’s picture

Status: Fixed » Active

This 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

jessebeach’s picture

Status: Active » Needs review

I've updated the documentation.

https://drupal.org/project/navbar

Is this sufficient?

Wim Leers’s picture

Libraries 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.

Wim Leers’s picture

Status: Needs review » Closed (duplicate)
Related issues: +#2167021: Revamp Libraries API integration
sibiru’s picture

Version: 7.x-1.1 » 7.x-1.4
Status: Closed (duplicate) » Needs review

I 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"

hass’s picture

Version: 7.x-1.4 » 7.x-1.1
Status: Needs review » Closed (duplicate)

Looks like the incorrect reference to modernizr.min.js has been fixed everywhere in the module.

Tommy Kaneko’s picture

Latest 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.

/*!
 * modernizr 3.1.0
 */
rootwork’s picture

@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