Hi,

since I've upgraded to 7.x-2.0-alpha3 version, I couldn't change anything in the Flexslider optionset admin page. Loading the page and validating the form without any change was generating these errors :

To use Thumbnail Captions you must install FlexSlider version 2.2 or higher.
To use Display both thumbnail captions and normal captions you must install FlexSlider version 2.2 or higher.

After some search, I found that it was due to the fact that 2 components, thumbCaptions and thumbCaptionsBoth were calling a validation function _flexslider_validate_minimum_version_22() that returned the error. And, these compents are visible only if we select "Thumbnails" as "Paging controls".
I don't use any of them, but the element validate function is still applied.

So, I just modified the function to check up if the field was checked before verifying the library version. If we don't use these options, no need to upgrade library, wright ?

flexslider.admin.inc - line 548

<?php
function _flexslider_validate_minimum_version_22($element, &$form_state) {
 
$lib = libraries_detect('flexslider');
 
$version = $lib['version'];
 
$required = "2.2";
-  if (!
version_compare($version, $required, '>=')) {
+  if (
$element['#value'] && !version_compare($version, $required, '>=')) {
   
form_error($element, t('To use %name you must install FlexSlider version !required or higher.', array(
     
'%name' => $element['#title'],
     
'!required' => l($required, 'https://github.com/woothemes/FlexSlider/tree/version/2.2'),
    )));
  }
}
?>

And everything is back to normal.
Hope it can help.

Files: 
CommentFileSizeAuthor
#9 detect-flexslider-2305609-9.patch544 bytesprogpapa
#6 detect-flexslider-2305609.patch570 bytesrhys
FAILED: [[SimpleTest]]: [MySQL] 100 pass(es), 44 fail(s), and 0 exception(s).
[ View ]

Comments

MtRoxx’s picture

THANK YOU - you helped me!

liezie_D’s picture

More information about this:

I had the same issue on a fresh install with
Flex Slider module v2.0 alpha3
Flex Slider library version 2.3.0

I couldn't create new option-sets and flex slider wasn't working on views.

I did a debug of $lib = libraries_detect('flexslider'); and this showed me there was no "version" tag in 2.3.0 of the library.
I downgraded the library to 2.2.0; this one did return a "version" tag.

After the downgrade, i no longer got this error and the view with flex slider worked.

So there is some incompatibility with version 2.3.0 of the js library

Steven Merrill’s picture

The version number has been taken out of the minified version of FlexSlider 2.3.0. This breaks the detection.

(Take a look at https://github.com/woothemes/FlexSlider/commit/58a4981c7b39e384f56831fd3... and open the diff.)

Nicolás Vásquez’s picture

It worked like a charm :) Thanks

lalit774’s picture

I am also getting same type of issue. spent some time for troubleshooting. I found jquery.flexslider-min.js version comment missing. It seems like drupal try to get version from js file.

https://github.com/woothemes/FlexSlider/issues/1271

rhys’s picture

StatusFileSize
new570 bytes
FAILED: [[SimpleTest]]: [MySQL] 100 pass(es), 44 fail(s), and 0 exception(s).
[ View ]

I had a similar problem with detection of the latest flexslider version. I've attached a patch that uses the normal js to detect the version, as both the min and the normal JS are detected to exist before getting to the version detection, and it's more likely that the version will be in the normal version rather than the minified version.

Status:Needs review» Needs work

The last submitted patch, 6: detect-flexslider-2305609.patch, failed testing.

rpsu’s picture

I think version check against jquery.flexslider.js is fine. Perhaps it would be a good thing to use file_exists(), though.

EDIT: File existence is checked before, so disregard file_exists() -part. :/

progpapa’s picture

StatusFileSize
new544 bytes

I think the main problem is not in the install file.

The missing version from jquery.flexslider-min.js v2.3 causes two problems:

1. On the admin "Status report" page I always get the "FlexSlider version could not be determined. Please consult the README.txt for installation instructions." message. The patch in #6 fixes this.

2. More importantly jquery.flexslider-min.js is not loaded at all. This is because libraries_load('flexslider'); fails. (returned error message: The version of the FlexSlider library could not be detected.) The attached patch is a simple fix in flexslider_libraries_info() to check the version in jquery.flexslider.js instead of the minified file.

lalit774’s picture

#6 and #9: These are not a good solution. This is not fixing real problem. The real problem is in jquery.flexslider-min.js file and flexslider guys fixed that.

Now if you install flexslider with latest library. it should work perfectly without any patch.

or even somebody get same error. just add follwoing comment lines in jquery.flexslider-min.js on top. This will fix your issue.

/*
jQuery FlexSlider v2.3.0
Copyright 2012 WooThemes
Contributing Author: Tyler Smith */
rpsu’s picture

The only breaking version is jQuery Flexslider v2.3.0., see this issue in Github.

lalit774’s picture

This is broken in version 2.3.0. They did not fix in existing version. just move on next version.