Hi
When I try to activate the module, I got

atal error: Call to undefined function libraries_detect() in /homepages/19/d296203842/htdocs/ontheroute/sites/all/modules/imageflow/imageflow.install on line 84
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ewheel’s picture

same. after update module cant find library.

You need to install the Imageflow library. The js file should be readable at sites/*/libraries/imageflow/imageflow.js. You can find the library at http://finnrudolph.de/ImageFlow/Download. (Сейчас используется Imageflow library Library required for Imageflow)

jamesbenison’s picture

To clarify, you are using a branch of libraries version 7.x-2.x?

That function should be in the module file for that module (not an include).

Also try flushing your cache.

ewheel’s picture

Libraries 7.x-2.1 - All caches flushed

jamesbenison’s picture

Not cool. The version of imageflow I have in front of me is getting new stuff added to it. I'll need to set up a clean install to get this figured out.

jamesbenison’s picture

Okay, I was not able to duplicate the problem. But you guys both having it suggests to me that there must be a problem that I'm not catching.

Here's what I did. First I did a clean install of drupal 7.22 with libraries and imageflow-7.x-1.0-alpha3 (and admin_menu, but that's irrelevant). I created a content type that basically just had images and a title. I set the field formatter to "imageflow" and the carousel showed up just fine.

Next I downloaded imageflow-7.x-1.0-alpha4 and imagecache_reflect. I ran the update script and it showed this: screenshot

The update script removed the reflection option from the preset and chose the new "imageflow_reflect" for the image style: screenshot

The new stuff I added to incorporate libraries API 2.x appears to work: screenshot

The carousel appears to work: screenshot

I seem to be missing something. Please help me try to figure that out.

BTW the function "libraries_detect" should be located at sites/*/modules/libraries/libraries.module

Also double check that the imageflow library is in the right place.

jamesbenison’s picture

Title: Error » Error when updating to alpha4

Changing the title for others. Also, did you run update.php?

ewheel’s picture

/var/www/sites/all/libraries/imageflow
/var/www/sites/all/modules/imagecache_reflect
/var/www/sites/all/modules/libraries

and yes i run update.php

jamesbenison’s picture

From what I can see you are getting "library not found" rather then a fatal error "call to undefined function".

Try going to you command prompt and type:

cd /var/www/sites/all/libraries/
sudo chmod -R 777 imageflow

Note this is for troubleshooting. Don't run a live site with those permissions.

Please give maximum details. I'm stabbing in the dark 'cause I still don't have a solid grasp on what is broken.

ewheel’s picture

FreeBSD 9.1 / apache 2.2.23 / PHP 5.4.10 / mysql 5.5.29 / drupal 7.22

- - -

# ls -la /var/www/sites/all/libraries/
total 17
drwxr-xr-x 11 www www 11 Jul 16 10:46 .
drwxr-xr-x 5 www www 6 May 25 14:41 ..
drwxrwxrwx 3 www www 18 May 25 14:41 imageflow

same error message "You need to install the Imageflow library...."

jamesbenison’s picture

This is bizarre and doesn't make sense. But in my experience when things are bizarre and don't make sense it's due to overlooking something obvious.

Try going into the file imageflow.install and comment out the function "imageflow_requirements". It runs from line 77 to 107. That's the function that is giving you grief right now. What I'm wondering is if the library file would be found after that function if commented out.

ewheel’s picture

after that function commented out - library file found =) but carousel broken now

jamesbenison’s picture

The library is obviously not getting found and/or loaded correctly.

Navigate to admin/config/media/imageflow/library and post a screenshot.

jamesbenison’s picture

Also, at the command prompt please try running:

# ls -la /var/www/sites/all/libraries/imageflow/

and post that result.

ewheel’s picture

FileSize
83.18 KB

# ls -la /var/www/sites/all/libraries/imageflow/
total 102
drwxrwxrwx 3 www www 18 May 25 14:41 .
drwxr-xr-x 11 www www 11 Jul 16 10:46 ..
-rwxrwxrwx 1 www www 219 Feb 25 2010 button_left.png
-rwxrwxrwx 1 www www 2826 Mar 9 2010 button_pause.png
-rwxrwxrwx 1 www www 216 Mar 9 2010 button_play.png
-rwxrwxrwx 1 www www 216 Feb 25 2010 button_right.png
-rwxrwxrwx 1 www www 1150 Feb 25 2010 favicon.ico
-rwxrwxrwx 1 www www 1968 Mar 9 2010 imageflow.css
-rwxrwxrwx 1 www www 40592 Mar 9 2010 imageflow.js
-rwxrwxrwx 1 www www 1514 Mar 9 2010 imageflow.packed.css
-rwxrwxrwx 1 www www 13424 Mar 9 2010 imageflow.packed.js
drwxrwxrwx 2 www www 6 May 25 14:41 img
-rwxrwxrwx 1 www www 2014 Mar 9 2010 index.html
-rwxrwxrwx 1 www www 10769 Feb 25 2010 reflect2.php
-rwxrwxrwx 1 www www 11286 Feb 25 2010 reflect3.php
-rwxrwxrwx 1 www www 258 Feb 25 2010 slider.png
-rwxrwxrwx 1 www www 260 Feb 25 2010 slider_dark.png
-rwxrwxrwx 1 www www 553 Feb 25 2010 style.css

jlsegul’s picture

I am having the exact same problem, except that it will not even allow me to enable the alpha4 module since it can't find the library.

I then tried to install the alpha3 module and had no problem, so it was not that the imageflow was in the wrong place.

jamesbenison’s picture

I'm starting to think it's in the function imageflow_libraries_info (implements hook_libraries_info from the libraries module). It looks for a version number and if it isn't found the whole thing explodes.

Around line 211 of the imageflow.module file.

'version arguments' => array(
    'file' => 'imageflow.js',
    'pattern' => '@(?i:Version:)\s+([0-9\.]+)@',
    'lines' => 5,
 ),

I'm thinking that if the replacement pattern was hard coded to find the string "1.3.0" and it fixed the problem we would know.

It already works fine on my machine, which is a problem when it comes to me trying to figure out what might be wrong. I still haven't been able to reproduce it.

jamesbenison’s picture

To be more clear, at about line 221 of imageflow.module try replacing this line:

'pattern' => '@(?i:Version:)\s+([0-9\.]+)@',

With this line:

'pattern' => '@(1.3.0)@',
ewheel’s picture

FileSize
118.15 KB

no result. still not working. all caches flushed.

jamesbenison’s picture

ewheel

Since I still cannot duplicate this problem to troubleshoot it, I was wondering if you could print the output of one of the variables for me.

On line 528 in the imageflow.module file you should have:

$library = libraries_detect('imageflow');

Just after that line could you insert this snippet?

drupal_set_message('<pre>'. print_r($library, TRUE) .'</pre>');

Obviously don't include the php tags.

Then navigate to the page where your imageflow should be up and cut and paste the output in a message. You might need to refresh the page before it shows.

EDIT: I was looking at the wrong screenshot. It looks like it's being detected fine. Also try turning off js and css aggregation. And if you could provide a link to a live example that isn't working that would also help.

jamesbenison’s picture

More than one problem here. I did reproduce the one reported by jlsegul. That's a definite issue in the install file. Make the following changes in the install file starting at line 78.

$requirements = array();
  if ($phase == 'install' || $phase == 'runtime') {
    if ($phase == 'install') {
      $imageflow = drupal_get_path('module', 'imageflow');
      require_once $imageflow . '/imageflow.module';
    }
    $library = libraries_detect('imageflow');

Change to:

$requirements = array();
  if ($phase == 'runtime') {
    $library = libraries_detect('imageflow');

I didn't catch it because it only happens when installing alpha4 fresh. Upgrading from alpha3 to alpha4 does not cause this. I'll update the dev branch with this change.

jamesbenison’s picture

Title: Error when updating to alpha4 » Error when installing alpha4
Status: Active » Fixed

Pushed this change to the dev branch. Might be a few before it updates. Changing issue name.

ewheel the problem you are having with the imageflow not displaying correctly isn't related to this.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.