Problem

I was trying to uninstall the simpletest module. I couldn't do it due to an abnormally error.
"Call to undefined function simpletest_clean_environment() in /var/www/html/acuvue/sites/all/modules/contributed/simpletest/simpletest.install, line 170"

How to reproduce:

In admin area:

  • Enable Testing Api and Testing Api monitor.
  • Disable Testing Api and Testing APi monitor.
  • Uninstall Testing Api.
  • The error should appear: Fatal error: Call to undefined function simpletest_clean_environment() in /home/d147b/www/sites/default/modules/simpletest/simpletest.install on line 170

This is the drush error when trying to uninstall the module.

/var/www/html/devcom/sites/all/modules/contributed/simpletest$ drush pmu simpletest
The following modules will be uninstalled: simpletest
Do you really want to continue? (y/n): y
PHP Fatal error:  Call to undefined function simpletest_clean_environment() in /var/www/html/devcom/sites/all/modules/contributed/simpletest/simpletest.install on line 171
PHP Stack trace:
PHP   1. {main}() /home/progestag/.composer/vendor/drush/drush/drush.php:0
PHP   2. drush_main() /home/progestag/.composer/vendor/drush/drush/drush.php:11
PHP   3. Drush\Boot\BaseBoot->bootstrap_and_dispatch() /home/progestag/.composer/vendor/drush/drush/drush.php:70
PHP   4. drush_dispatch() /home/progestag/.composer/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php:62
PHP   5. call_user_func_array() /home/progestag/.composer/vendor/drush/drush/includes/command.inc:178
PHP   6. drush_command() /home/progestag/.composer/vendor/drush/drush/includes/command.inc:178
PHP   7. _drush_invoke_hooks() /home/progestag/.composer/vendor/drush/drush/includes/command.inc:210
PHP   8. call_user_func_array() /home/progestag/.composer/vendor/drush/drush/includes/command.inc:359
PHP   9. drush_pm_uninstall() /home/progestag/.composer/vendor/drush/drush/includes/command.inc:359
PHP  10. _drush_pm_uninstall() /home/progestag/.composer/vendor/drush/drush/commands/pm/pm.drush.inc:1190
PHP  11. drush_module_uninstall() /home/progestag/.composer/vendor/drush/drush/commands/core/drupal/pm.inc:153
PHP  12. drupal_uninstall_modules() /home/progestag/.composer/vendor/drush/drush/commands/core/drupal/environment_7.inc:176
PHP  13. module_invoke() /var/www/html/devcom/includes/install.inc:809
PHP  14. call_user_func_array() /var/www/html/devcom/includes/module.inc:926
PHP  15. simpletest_uninstall() /var/www/html/devcom/includes/module.inc:926

Fatal error: Call to undefined function simpletest_clean_environment() in /var/www/html/devcom/sites/all/modules/contributed/simpletest/simpletest.install on line 171

Call Stack:
    0.0003     245416   1. {main}() /home/progestag/.composer/vendor/drush/drush/drush.php:0
    0.0003     245608   2. drush_main() /home/progestag/.composer/vendor/drush/drush/drush.php:11
    0.1625    7928320   3. Drush\Boot\BaseBoot->bootstrap_and_dispatch() /home/progestag/.composer/vendor/drush/drush/drush.php:70
    0.8307   20622456   4. drush_dispatch() /home/progestag/.composer/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php:62
    0.9426   22711336   5. call_user_func_array() /home/progestag/.composer/vendor/drush/drush/includes/command.inc:178
    0.9426   22711824   6. drush_command() /home/progestag/.composer/vendor/drush/drush/includes/command.inc:178
    0.9428   22712960   7. _drush_invoke_hooks() /home/progestag/.composer/vendor/drush/drush/includes/command.inc:210
    0.9435   22747616   8. call_user_func_array() /home/progestag/.composer/vendor/drush/drush/includes/command.inc:359
    0.9435   22748000   9. drush_pm_uninstall() /home/progestag/.composer/vendor/drush/drush/includes/command.inc:359
    0.9456   22785416  10. _drush_pm_uninstall() /home/progestag/.composer/vendor/drush/drush/commands/pm/pm.drush.inc:1190
    5.2312   24078096  11. drush_module_uninstall() /home/progestag/.composer/vendor/drush/drush/commands/core/drupal/pm.inc:153
    5.2313   24078304  12. drupal_uninstall_modules() /home/progestag/.composer/vendor/drush/drush/commands/core/drupal/environment_7.inc:176
    5.2332   24149240  13. module_invoke() /var/www/html/devcom/includes/install.inc:809
    5.2332   24149592  14. call_user_func_array() /var/www/html/devcom/includes/module.inc:926
    5.2332   24149832  15. simpletest_uninstall() /var/www/html/devcom/includes/module.inc:926

Drush command terminated abnormally due to an unrecoverable error.                                                                                                      [error]
Error: Call to undefined function simpletest_clean_environment() in /var/www/html/devcom/sites/all/modules/contributed/simpletest/simpletest.install, line 171
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Yago Elias created an issue. See original summary.

Yago Elias’s picture

I have this patch. This should solve the "Call to undefined function" problem.

Yago Elias’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: can_t_uninstall-2820840-2.patch, failed testing.

The last submitted patch, 2: can_t_uninstall-2820840-2.patch, failed testing.

Yago Elias’s picture

I uploaded a new patch... I forgot some comentary on the code.

Yago Elias’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 6: can_t_uninstall-2820840-6.patch, failed testing.

Yago Elias’s picture

Assigned: Unassigned » Yago Elias
Yago Elias’s picture

Title: Can't uninstall simpletest due to an abnormally error "Call to undefined function simpletest_clean_environment() in /var/www/html/acuvue/sites/all/modules/contributed/simpletest/simpletest.install, line 170" » Can't uninstall simpletest due to a FATAL error "Call to undefined function simpletest_clean_environment() in /var/www/html/acuvue/sites/all/modules/contributed/simpletest/simpletest.install, line 170"
Yago Elias’s picture

Assigned: Yago Elias » Unassigned

  • BR0kEN committed d414655 on 7.x-2.x authored by Yago Elias
    Issue #2820840 by Yago Elias: Can't uninstall simpletest due to a FATAL...
BR0kEN’s picture

Status: Needs work » Fixed

  • BR0kEN committed fc1a0cc on 7.x-2.x
    Issue #2820840 by Yago Elias, BR0kEN: Simplify "module_load_include()"
    

Status: Fixed » Closed (fixed)

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

Anybody’s picture

Priority: Normal » Major

The stable release still seems broken? Shouldn't there be a new release then? This is an important issue... uninstall should work with a stable module version.

BR0kEN’s picture

Anybody’s picture

Thank you very very much for your quick reaction, BR0kEN! That's great!