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.
Fatal error: Call to undefined function libraries_get_path() in F:\www\drupal7\sites\all\modules\views_slideshow\contrib\views_slideshow_cycle\views_slideshow_cycle.module on line 13
So I updated Views slideshow today and got this problem.
When I try update.php, it informs me that I libraries is missing so I downloaded libraries module and paste it on modules.
I tried update.php again and the problem with libraries is now gone and I can continue to update but still the problem above persist.
I rollback my Views Slideshow from my backup for now.
Comment | File | Size | Author |
---|---|---|---|
#32 | views_slideshow_cycle-libraries.patch | 800 bytes | denbrice |
#27 | views_slideshow_cycle-hook-requirements-broken-1090052-27.patch | 3.46 KB | eft |
#25 | views_slideshow-requirements_libraries_WSOD-1012468-25.patch | 855 bytes | David Stosik |
Comments
Comment #1
mjgruta CreditAttribution: mjgruta commentedsolution for me right now is to make sure that libraries module is enabled first before updating.
Comment #2
Ganganation CreditAttribution: Ganganation commentedHaving the same issue! I will try to downgrade to the previous slideshow version, first enable the libraries module (& install) than update the module again. This is a pretty major bug? Are more people experiencing the same problem?
Comment #3
Ganganation CreditAttribution: Ganganation commentedTested (see post #2) and this worked.
On the notes page of 7.x-3.x-alpha1 you will find that they warn you for this problem http://drupal.org/node/1090018
I guess you should always first read the release notes.
Though the new implementation of drupal 7 to download the newest version (of your modules) makes it easier to download but you will skip the notes a lot faster.
Haha, though master... Always read the notes for dev modules :P
Comment #4
anusornwebsite CreditAttribution: anusornwebsite commentedI don't get your solution very well. I'm just amateur for Drupal and English language. Did you mean I should replace views_slideshow 7.x-3.0-alpha1 with 7.x-3.x-dev? Now I can't do anything with my website except by FileZilla. Please help me I don't want to mistake again.
Comment #5
anusornwebsite CreditAttribution: anusornwebsite commentedFatal error: Call to undefined function libraries_get_path() in /home/sitename/public_html/sites/all/modules/views_slideshow/contrib/views_slideshow_cycle/views_slideshow_cycle.module on line 13
This is my problem and I used FileZilla to replace views_slideshow 7.x-3.0-alpha1 by 7.x-3.x-dev but it isn't work. I have still this problem. Please help me right now.
Comment #6
Ganganation CreditAttribution: Ganganation commentedHi anusornwebsite,
first of all: you can always go back to the earlier version module (views_slideshow 7.x-3.0-alpha1) by replacing the new one with the old.
It's OK that you uploaded with filezilla.
After you downgraded to the alpha version, install & active the following module: http://drupal.org/project/libraries (this is new in the 7.x-3.x-dev version)
Than you should empty your cache http://yoursite.com/admin/config/development/performance
That should work.
Hope this helps.
Please let me know if it helped and if it did not help.
Thank you :D
Comment #7
redndahead CreditAttribution: redndahead commentedYes Please read the release notes before upgrading. Even if you use the update functionality in drupal 7. Libraries module is REQUIRED before upgrading.
Comment #8
anusornwebsite CreditAttribution: anusornwebsite commentedI followed your suggest by replacing the new one with the old. and I installed "libraries" in site/all/. it's not work and try to installed "libraries" in site/all/modules/. It's still not work. finally, I decided to delete views_slideshow it's ok.
I don't remember when I first installed views_slideshow but I won't install it again
thank you for your suggestion
Comment #9
thedayway CreditAttribution: thedayway commentedQuestions to others:
- is this a good solution? should the database be updated?
- is the libaries a libary or a module?
thanks for anwsering
Comment #10
redndahead CreditAttribution: redndahead commented@thedayway Follow these steps
1) Open up contrib/views_slideshow_cycle/views_slideshow_cycle.module
2) Comment out lines 13 and 19 It should have libraries_get_path in those lines
3) Download http://drupal.org/project/libraries
4) Enable that module
5) Uncomment lines 13 and 19
It should then be fine.
Comment #11
orendain CreditAttribution: orendain commented#10 works perfectly, thanks.
Comment #12
jim005 CreditAttribution: jim005 commentedsame. #10 works perfectly, thanks.
Comment #13
Ganganation CreditAttribution: Ganganation commented#10 works but it is not a pretty solution, is it?
Comment #14
redndahead CreditAttribution: redndahead commentedNo it isn't, but I hope people will read the release notes before upgrading. Or read the big bolded text on the project page.
Comment #15
Flex CreditAttribution: Flex commentedThanks redndahead,
appreciate the fix and I will be more deligent about reading release notes in the future
Comment #16
joemoraca CreditAttribution: joemoraca commentedGoing through the steps in #10 fixed the problem for me -- but I had the libraries module enabled before the upgrade and it was in use by other modules.
Comment #17
dibya CreditAttribution: dibya commentedthanks .it worked for me
Comment #18
camorim CreditAttribution: camorim commentedThanks it worked for me too, but it nearly killed my faint heart ;-)
I was upgrading with drush, so not even thought in looking to the release notes.
Is there any chance to send a message during a drush update or install?
Comment #19
Deciphered CreditAttribution: Deciphered commentedredndahead,
You could put some code similar to the following to prevent the issue:
That way Views Slideshow will look for Libraries, try to enable it if it isn't already enabled, and if that doesn't work it will set an error and disabled Views Slideshow. Might help.
Comment #20
redndahead CreditAttribution: redndahead commentedI committed a change where it won't load the javascript if libraries doesn't exist. I didn't want to throw an error on the page directly. If someone sees the slideshow isn't working they will more than likely go to the settings page of the view where they can see the error.
Comment #22
adrian.higuita CreditAttribution: adrian.higuita commentedHi,
That happened to me the same ... succeeded in restoring the system to delete modules View, views_slideshow y folder libraries
then returned to copy the original folders in /sites/all/libraries and /sites/all/modules/view and views_slideshow
Comment #23
atmosfearic1 CreditAttribution: atmosfearic1 commented#10 Thanks so much!
Comment #24
David Stosik CreditAttribution: David Stosik commentedHello,
There is no acceptable fix at the moment.
Asking the admin to install libraries BEFORE putting views_slideshow files on the server is not a fix, and this requirement cannot always be fulfilled. First use case is when you deliver an update with those two modules, and an automated procedure to update the website.
Second one (which I am facing now) is when you have a whole Drupal tree automatically built (think Drush make), and then begin installing a profile which requires both modules, and you're screwed with a WSOD.
Third one I just thought about: copy both modules to your Drupal files, install Views Slideshow via modules pages ; the 'Library' dependency should be automatically installed, but it is too late, hook_requirements will fail with a WSOD.
I suggest writing a patch that at least makes the code safe (in case Libraries module is not installed), and at best provides an alternative way to check the existence of the library.
I'll provide the patch in some time.
David
Comment #25
David Stosik CreditAttribution: David Stosik commentedAnd here is the patch, on 7.x-3.x-dev.
Comment #26
David Stosik CreditAttribution: David Stosik commentedStill not working on 3.x-dev, so upping here. :)
Comment #27
eft CreditAttribution: eft commentedI would also really like to see the hook_requirements code fixed. Here is a patch that builds on the one provided by David Stosik. It partly borrows from the Superfish module in that it first checks that the Libraries module is present at all. It the maintainers can commit this patch then we can close this issue and #1499552: Call to undefined function _views_slideshow_cycle_pause_libary_path().
Thanks
Comment #28
Deciphered CreditAttribution: Deciphered commentedQuick review:
The requirement key should be related to the actual requirement, not the module requiring it, this allows for multiple modules to share a single requirement instead of multiple entires in the status report.
The first check should return after the Libraries module wasn't found so to prevent the need for this check.
Comment #29
eft CreditAttribution: eft commented@Deciphered.
Thanks for reviewing the patch.
Regarding the key name, I understand what you're saying but how do you construct a key that will be common to all modules requiring the libraries module? Is there a convention? What would you suggest as a key? "jquery.cycle"?
If I understand your second point correctly, you are saying that there is no point in checking for the existence of the
libraries_get_path
function if the path to the libraries module cannot be found. I believe that is how the patch logic is structured. The second check is required to bootstrap the libraries module because during site installation it won't yet be available to the hook_requirements function.Either way, I believe the patch solves the problem that currently exists when performing site installs that depend on this module.
Comment #30
Deciphered CreditAttribution: Deciphered commented'libraries' would be the obvious one.
As for the second point, if you stick a return inside the first check for the Libraries module it will prevent the code executing further if the libraries module doesn't exist, in which case if it where to get to the second condition it's clear that the module does exists, in which case the if statement isn't required, so you can simple do the include without the check for the existence of the module at that point.
Comment #31
eft CreditAttribution: eft commentedok, 'libraries' then. I guess for this be of real benefit one would need to co-ordinate with all other module maintainters that have the same requirement so that their hook_requirements use the same key.
The second check
if (!function_exists('libraries_get_path'))
isn't checking for the existence of the module in the file system. It is checking to see if the function is available. During drupal installation the requirements stage precedes the installation and loading of modules that are depended upon so even if Libraries exists in the platform or site code base it won't be available to the hook. If the user is enabling this module post drupal installation the function should be available and the module need not be loaded.Comment #32
denbrice CreditAttribution: denbrice commentedHi,
I created attached patch which fixes this error message when installing the module.
This is no workaround, but an actual fix that includes the libraries.module when installing the
views_slideshow_cycle module.
Please review.
Thanks!
Comment #33
eft CreditAttribution: eft commentedThanks for the patch. How is that different from the one in #25 above?
Comment #34
Deciphered CreditAttribution: Deciphered commentedIt's worse than #25, because it just assumes that the libraries module exists, which means if it doesn't exist it will fail.
If you're adding a dependency to a module that wasn't previously a dependency you need to assume that the module doesn't exist and check for it, it also doesn't hurt to attempt to enable it if it's present but disabled, and failing that terminate the process and throw an error so the user knows that they need to get that dependency installed ASAP, even going so far as disabling the module so that the site (other than the specific functionality provided by the module) runs properly.
Comment #35
eft CreditAttribution: eft commented@Deciphered. I was hoping you would follow up on my response above.
Would you support my patch in #27 if I changed the requirements key to 'libraries'?
Comment #36
Deciphered CreditAttribution: Deciphered commentedBased on my feedback in #28, yes, I would. I did take a quick glance just now and did see at least one coding standards issue, but that wasn't introduced by the patch it was part of the original code, so not really relevant.
I haven't had time to look further into the patch though as it's not an issue that effects me anymore, so I couldn't RTBC it for you.
Comment #37
xiukun.zhou CreditAttribution: xiukun.zhou commentedThis patch looks good, but I apply my project fails. Can you create a new patch?
Comment #38
xiukun.zhou CreditAttribution: xiukun.zhou commentedThanks
I just manually applied #27 patch. work to me.
commit: d1d7371