The libraries_detect() function in libraries.module checks twice whether the major version number is empty or not. If the major version number is found but 0, the module thinks the version number is not detected.

Error message:

The version of the LIBRARY_NAME library could not be detected.

A solution would be to add extra conditions to check whether the major version number is not 0.

v7.x-2.x-dev at line 500:

if (empty($library['version']) && $library['version'] != '0') {
  // ...
}

and v7.x-2.x-dev at line 518:

if (!$version && $version != '0') {
  // ...
}

Update:
It only occurs when one uses a pattern that detects the major version number apart from the minor version number, as done with the TinyMCE example in libraries.api.php.

Old pattern (problem occurs):
'@"version": *"(\d+)\.([\d.]+)"@'

New pattern (problem solved):
'@"version": *"([\d.]+)"@'

Comments

lmeurs’s picture

Issue summary: View changes

Added error message

lmeurs’s picture

Issue summary: View changes

Added 2nd check at line 518

lmeurs’s picture

Status: Active » Closed (works as designed)

I am sorry, my mistake. I used example code without reading the comments well enough. Case closed!

lmeurs’s picture

Issue summary: View changes

Added update