I can't uninstall this...

Fatal error: Call to undefined function media_youtube_variable_default() in sites/all/modules/media_youtube/media_youtube.install on line 19

this on -dev modules using git deploy.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

effulgentsia’s picture

Title: error while uninstalling! » Fatal error while uninstalling: undefined function media_youtube_variable_default()
Status: Active » Postponed (maintainer needs more info)

Are you uninstalling via the UI, via Drush, or some other utility? Are you able to reproduce this from a fresh site installation? If so, can you post the steps (e.g., install Drupal 7.0 using Standard profile, enable modules X,Y,Z (include versions of each one, please), disable modules A,B,C, uninstall media_youtube)? If you feel like making a screencast (e.g., with http://www.techsmith.com/jing/), even better. Thanks.

likewhoa’s picture

doing the uninstall from UI, i will try to reproduce on a fresh install but will take sometime. I cannot make a screencast sorry.

likewhoa’s picture

Status: Postponed (maintainer needs more info) » Active

confirmed on a fresh install of d7, media_youtube cannot be uninstall.

Steps to reproduce.

1. install latest -dev d7
2. use drush to install -dev (git_deploy) media & media_youtube plus dependencies
3. enable modules
4. run update.php
5. confirm modules are enabled then disable them
6. try to uninstall media_youtube
7. WSOD in UI and

# drush pm-uninstall media_youtube
The following modules will be uninstalled: media_youtube
Do you really want to continue? (y/n): y
PHP Fatal error:  Call to undefined function media_youtube_variable_default() in sites/all/modules/media_youtube/media_youtube.install on line 19

Fatal error: Call to undefined function media_youtube_variable_default() in sites/all/modules/media_youtube/media_youtube.install on line 19
Drush command te# drush pm-uninstall media_youtube
The following modules will be uninstalled: media_youtube
Do you really want to continue? (y/n): y
PHP Fatal error:  Call to undefined function media_youtube_variable_default() in sites/all/modules/media_youtube/media_youtube.install on line 19

Fatal error: Call to undefined function media_youtube_variable_default() in sites/all/modules/media_youtube/media_youtube.install on line 19
Drush command terminated abnormally due to an unrecoverable error.                                                                  [error]
Error: Call to undefined function media_youtube_variable_default() in
sites/all/modules/media_youtube/media_youtube.install, line 19
rminated abnormally due to an unrecoverable error.                                                                  [error]
Error: Call to undefined function media_youtube_variable_default() in
sites/all/modules/media_youtube/media_youtube.install, line 19

under drush.

effulgentsia’s picture

Thanks for the details. Can you please elaborate on:

2. use drush to install -dev (git_deploy) media & media_youtube plus dependencies

I don't use drush much, and am not familiar with how it relates to git_deploy. Can you post the sequence of drush commands? Thanks.

likewhoa’s picture

Well once you have drush installed, from your wwwroot run these commands. You'll also want to have $options['package-handler'] = 'git_drupalorg'; in your drushrc.php

# drush dl git_deploy-7.x-1.x-dev 
# drush -y en git_deploy
# drush dl ctools-7.x-1.x-dev styles-7.x-2.x-dev media-7.x-1.x-dev media_youtube-7.x-1.x-dev
# drush -y en ctools media media_youtube (this might be optional, since I have a wrapper for drush that automagically runs this for me)
# drush updb
# drush cc (select 1 to clear all site cache)

The check all media modules are working as expected, then to uninstall run.

# drush dis media media_youtube
# drush pm-uninstall media_youtube

It should have reproduced bug now,...

rodrigoaguilera’s picture

subscribe

benjohnstone’s picture

subscribe

BarisW’s picture

Same here

Jeff Burnz’s picture

Same, uninstalling using the UI.

steinmb’s picture

This prob. the same issue, only that I reported it in media_vimeo #1180030: Unable to uninstall - Call to undefined function media_vimeo_variable_default()

Edit: And yes, uninstalling from the GUI.

TimelessDomain’s picture

Problem is in the "foreach" line from the function below

/**
 * Implement hook_uninstall().
 */
function media_youtube_uninstall() {
  foreach (media_youtube_variable_default() as $variable => $value) {
    media_youtube_variable_del($variable);
  }
  return array(array('success' => TRUE, 'query' => "Deleted all variables in the Media: YouTube namespace."));
}
TimelessDomain’s picture

Adding the following to media_youtube.install allowed me to uninstall it

require_once ( dirname(__FILE__) . '/includes/media_youtube.variables.inc');

this was based upon #1169472: Call to undefined function media_variable_default() unable to uninstall media module ( i am not a coder)

notasheep’s picture

#12 worked for me

steinmb’s picture

Priority: Normal » Major
Status: Active » Needs review
FileSize
2.85 KB

In Drupal 7 have there been changes to the "autoloader" http://drupal.org/node/224333#absolute_includes, this patch try to follow these guidelines and it also try to fix the uninstall problem. The issue is that when the module is disabled, hook_uninstall does not load the .module —file. [1029606].

kreynen’s picture

I was able to uninstall after @steinmb's patch in #14

Haven't tested past that.

brunorios1’s picture

same here

juroon’s picture

#14 patch worked for me too.

steinmb’s picture

Status: Needs review » Reviewed & tested by the community
thebuckst0p’s picture

Thanks, patched worked for me too. Can someone commit?

rv0’s picture

patch worked, but has whitespace errors

likewhoa’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
2.73 KB

rerolled patch from #14

likewhoa’s picture

FileSize
2.73 KB

errr small typo on previous patch.

likewhoa’s picture

FileSize
2.73 KB

re-rolled an verified on both drush and UI. /me makes note not to submit patches in a hurry.

steinmb’s picture

Status: Needs review » Reviewed & tested by the community
clashar’s picture

thanks, patch works

anavarre’s picture

Subscribe

aaron’s picture

Status: Reviewed & tested by the community » Fixed

committed, thanks everyone!

Status: Fixed » Closed (fixed)

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

jdewantac’s picture

What are the steps to apply this patch?
I am stuck here. Please anyone can help?
Thanks

clashar’s picture

jdewantac,
you don't need to apply the above mentioned patch, because it already "committed" - means that is already in latest dev. version

jdewantac’s picture

how to fix the issue then?
I still cannot uninstal media_youtube

thanks clashar

clashar’s picture

jdewantac, you just delete the folder "sites\all\modules\media_youtube" and upload there the latest dev from "http://ftp.drupal.org/files/projects/media_youtube-7.x-1.x-dev.zip"

prShadoko’s picture

Hi clashar
I got this error and tried to follow your instructions, but it's still not working.
I moved the 'sites/all/modules/media_youtube/' folder away and extracted the content of the 'media_youtube-7.x-1.x-dev.tar.gz' archive to this place but the error persists...

In case it would help...

  • Drupal version : minimal-7.10
  • The folder has the right permissions.
  • No field is using the module.
  • In the module administration page, it is still listed as the former installed version ('7.x-1.0-alpha5').

Thanks for your help.

clashar’s picture

hi prShadoko,
Did you try clear cache or update?
and now what version of module is mentioned in file "sites\all\modules\media_youtube\media_youtube.info"?

prShadoko’s picture

Oups ! Mea culpa, I extracted the archive to another site... =__="
I feel quite stupid now, but after checking the right site, it works fine.
Thank you for your help and answering so quickly !

clashar’s picture

no problem), good luck!