Hi
Unable to uninstall, get this:

Call to undefined function media_variable_default() in /drupal/sites/all/modules/media/media.install on line 104

Is this function deprecated or not yet added to the code?

Comments

Mindexperiment’s picture

Version: 7.x-1.x-dev » 7.x-1.0-beta4
Priority: Critical » Normal

same error..

milesw’s picture

me too

mohan1411’s picture

Status: Active » Needs review
StatusFileSize
new334 bytes

Even I got this error when I try to uninstall media module. I got this fixed by including "media.variables.inc" file in the media.install.

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

Status: Needs review » Needs work

The last submitted patch, undefined-function-1169472-3.patch, failed testing.

mohan1411’s picture

Status: Needs work » Needs review

#3: undefined-function-1169472-3.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, undefined-function-1169472-3.patch, failed testing.

steinmb’s picture

To me this is only a work around and do not address the real problem. The file (includes/media.variables.inc) containing this function is already included by media.module, and should not need to be included one more time.

dilari’s picture

Although the #3 patch may not be a real solution it does help uninstalling the module..

elgandoz’s picture

subbing

carwin’s picture

subscribe

mrf’s picture

Status: Needs work » Needs review
StatusFileSize
new451 bytes

You can't call functions defined in a disabled module.

Instead of adding the missing function definitions I looked at what media_variable_default and media_variable_del were doing and came up with the following which accomplishes the same result in a less elegant way.

Status: Needs review » Needs work

The last submitted patch, media-uninstall-1169472.patch, failed testing.

mrf’s picture

Version: 7.x-1.0-beta4 » 7.x-1.x-dev
Status: Needs work » Needs review

My patch was against the latest dev...

mrf’s picture

#11: media-uninstall-1169472.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, media-uninstall-1169472.patch, failed testing.

fedik’s picture

I add next code in to up of the media.install file, and it work for me

<?php
// A registry of variable_get defaults.
require_once ( dirname(__FILE__) . '/includes/media.variables.inc');
?>
steinmb’s picture

Priority: Normal » Major
Status: Needs work » Needs review
StatusFileSize
new400 bytes

Like correctly stated in #11, the issue is, that when a module is disabled, hook_uninstall does not load the .module —file and non of the inc files get included. This patch is a onliner-fix that follow recommendations from this core issue #1029606: Regression: Not loading the .module file causes a fatal error when uninstalling some modules (as does loading it).

mrf’s picture

Status: Needs review » Reviewed & tested by the community

+1 to #17 better to load in everything for future compatability

brianV’s picture

+1 for this patch as well. I would like to see it committed ASAP, as you can't uninstall the current -dev branch without it.

hswong3i’s picture

subscribe

hswong3i’s picture

Patch via media-7.x-1.x GIT, tested with drupal-7.4 and uninstall successfully without WSOD.

fasdalf@fasdalf.ru’s picture

#17 and #21 work both. Thank you.

devin carlson’s picture

I tried patch in #21 and it worked for me.

likewhoa’s picture

#21 worked here too

aaron’s picture

Status: Reviewed & tested by the community » Fixed

awesome! got that committed to both the 7.x-2.x and 7.x-1.x branches. thanks, everyone!

Status: Fixed » Closed (fixed)

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