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
Comment #0.0
lmeurs CreditAttribution: lmeurs commentedAdded error message
Comment #0.1
lmeurs CreditAttribution: lmeurs commentedAdded 2nd check at line 518
Comment #1
lmeurs CreditAttribution: lmeurs commentedI am sorry, my mistake. I used example code without reading the comments well enough. Case closed!
Comment #1.0
lmeurs CreditAttribution: lmeurs commentedAdded update