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.
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
barraponto CreditAttribution: barraponto commentedHere' s a patch.
Comment #2
lhridley CreditAttribution: lhridley 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
lhridley CreditAttribution: lhridley commentedComment #4
bdgreen CreditAttribution: bdgreen commentedPatch following on from @lhridley comment #3
Comment #6
bdgreen CreditAttribution: bdgreen commentedSo patching contrib modules ... (node/707484) - resubmitted
Comment #7
lhridley CreditAttribution: lhridley commentedComment #8
JamesAn CreditAttribution: 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 CreditAttribution: bneil at The University of Iowa commentedSetting to fixed since this was committed.
Comment #12
nandt CreditAttribution: nandt commentedapply patch #8 solve the problem.
thanks
Comment #13
aaronsthomas74 CreditAttribution: aaronsthomas74 commentedPatch # 8 worked for me too.