When uninstalling this module the following error is being thrown:

PHP Fatal error: Call to undefined function twitter_block_clear_js_cache() in (my_installed dir)\twitter_block\twitter_block.install on line 77

Comments

amysteen’s picture

I 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 77

patkai’s picture

The 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.

patkai’s picture

StatusFileSize
new822 bytes

This 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.

patkai’s picture

Status: Active » Needs review
himanshupathak3’s picture

Hello 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.

Status: Needs review » Needs work

The last submitted patch, 5: uninstall_error-twitter_block-2389419.patch, failed testing.

himanshupathak3’s picture

Hello 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.

The last submitted patch, 5: uninstall_error-twitter_block-2389419.patch, failed testing.

himanshupathak3’s picture

jsacksick’s picture

Version: 7.x-2.2 » 7.x-2.x-dev
Status: Needs work » Needs review
StatusFileSize
new462 bytes

I also got the error, and the attached patch fixed the issue for me.

ahillio’s picture

Patch #11 solved this for me. Thank you!!

bisonbleu’s picture

Ran into this issue. Patch in #11 works for me too. Thanks @himanshupathak3 & @jsacksick !

ladybug_3777’s picture

Patch #11 worked for me as well. Thanks!

devin carlson’s picture

Status: Needs review » Fixed

Thanks for the patch!

Committed #3 to Twitter Block 7.x-2.x.

Status: Fixed » Closed (fixed)

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