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.

Comments

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.

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

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.

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.

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

subscribe

subscribe

Same here

Same, uninstalling using the UI.

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.

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."));
}

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)

#12 worked for me

Priority:Normal» Major
Status:Active» Needs review
StatusFileSize
new2.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].

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

Haven't tested past that.

same here

#14 patch worked for me too.

Status:Needs review» Reviewed & tested by the community

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

patch worked, but has whitespace errors

Status:Reviewed & tested by the community» Needs review
StatusFileSize
new2.73 KB

rerolled patch from #14

StatusFileSize
new2.73 KB

errr small typo on previous patch.

StatusFileSize
new2.73 KB

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

Status:Needs review» Reviewed & tested by the community

thanks, patch works

Subscribe

Status:Reviewed & tested by the community» Fixed

committed, thanks everyone!

Status:Fixed» Closed (fixed)

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

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

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

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

thanks clashar

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"

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.

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"?

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 !

no problem), good luck!