JQuery Version check for equal or greater than 1.7 bug found in the .module file:
if ( floatval($matches[1] .'.'. $matches[2]) >= 1.7) { // line #37...}
will return false for any version of JQuery greater than 1.9. For example:
The code about will return false for JQuery version 1.10 or 1.11 or 1.12 ,etc since 1.7 > 1.10
Here is my propose fix:
if ($matches[1] >= 1 && $matches[2] >= 7) { ... }
this should fix the problem.
Fred.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | bootstrap_library-jquery_version_check-2244553-8.patch | 716 bytes | JamesAn |
| #6 | bootstrap_library-jquery_version_check-2244553-6.patch | 818 bytes | bdgreen |
Comments
Comment #1
barrapontoHere' s a patch.
Comment #2
lisa.rae commentedNote: Conversion of the version number to a float value is an invalid comparison when checking software versions.
Confirmed patch fixes version check issue with jQuery; however:
A better check would be to use the PHP function version_compare(). This would eliminate the need for the regular expression altogether. Using version_compare(), the block f code checking the jQuery library version would be:
Comment #3
lisa.rae commentedComment #4
bdgreen commentedPatch following on from @lhridley comment #3
Comment #6
bdgreen commentedSo patching contrib modules ... (node/707484) - resubmitted
Comment #7
lisa.rae commentedComment #8
JamesAn commentedTwo very minor coding style correction. As per the Drupal coding standards, control statements should not have any whitespace between the opening parenthesis and the first condition (i.e. like this: "if (version...", not like this: "if ( version..."). Also, the comment line should maintain it's indent level; I'm not sure why that change is being proposed/accepted.
Since I'm pointing out these issues, I've rolled the patch with these two cosmetic fixes.
Comment #10
polWhy not creating a new release with this patch included ?
Comment #11
bneil commentedSetting to fixed since this was committed.
Comment #12
nandt commentedapply patch #8 solve the problem.
thanks
Comment #13
aaronsthomas74 commentedPatch # 8 worked for me too.