Closed (fixed)
Project:
Twitter Block
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Dec 2014 at 19:09 UTC
Updated:
29 Sep 2015 at 20:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
amysteen commentedI also have this error.
Problem/Motivation
Had Twitter Block 7.x-2.2 installed on a site and decided to disable and uninstall. After the uninstall confirmation page, I got the following error:
PHP Fatal error: Call to undefined function twitter_block_clear_js_cache() in (my_installed dir)\twitter_block\twitter_block.install on line 77Comment #2
patkai commentedThe problem is that when the uninstall hook is called the module is already turned off. When the module is turned off you can't call any of the functions declared in the .module file, so a temporary quick fix would be to comment out line 77 in the .install file. Some cached files won't be removed but the uninstall will run and remove the schema from the db. But I will make a patch soon with a proper solution.
Comment #3
patkai commentedThis patch removes the twitter_block_clear_js_cache() function from the install hook and moves it to the disable hook. The idea is that when the module is turned off this function will be called.
Comment #4
patkai commentedComment #5
himanshupathak3 commentedHello when you are trying to uninstalling the module, remember the module has been already disabled so can't call any function from the module file.
What we need to do is move the function
twitter_block_clear_js_cache()from .module file to .install file.I have created a patch for it and it works.
Comment #7
himanshupathak3 commentedHello Guys,
Previous patch #5 might give you issue as it is showing my whole drupal modules path. I have created another patch from the same folder.
Comment #10
himanshupathak3 commentedComment #11
jsacksick commentedI also got the error, and the attached patch fixed the issue for me.
Comment #12
ahillio commentedPatch #11 solved this for me. Thank you!!
Comment #13
bisonbleu commentedRan into this issue. Patch in #11 works for me too. Thanks @himanshupathak3 & @jsacksick !
Comment #14
ladybug_3777 commentedPatch #11 worked for me as well. Thanks!
Comment #15
devin carlson commentedThanks for the patch!
Committed #3 to Twitter Block 7.x-2.x.