Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
#6 | can_t_uninstall-2820840-6.patch | 389 bytes | Yago Elias |
#2 | can_t_uninstall-2820840-2.patch | 391 bytes | Yago Elias |
Comments
Comment #2
Yago Elias CreditAttribution: Yago Elias as a volunteer and at CI&T commentedI have this patch. This should solve the "Call to undefined function" problem.
Comment #3
Yago Elias CreditAttribution: Yago Elias as a volunteer and at CI&T commentedComment #6
Yago Elias CreditAttribution: Yago Elias as a volunteer and at CI&T commentedI uploaded a new patch... I forgot some comentary on the code.
Comment #7
Yago Elias CreditAttribution: Yago Elias as a volunteer and at CI&T commentedComment #9
Yago Elias CreditAttribution: Yago Elias as a volunteer and at CI&T commentedComment #10
Yago Elias CreditAttribution: Yago Elias as a volunteer and at CI&T commentedComment #11
Yago Elias CreditAttribution: Yago Elias as a volunteer and at CI&T commentedComment #13
BR0kENComment #16
AnybodyThe 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.
Comment #17
BR0kENhttps://www.drupal.org/project/simpletest/releases/7.x-2.1
Comment #18
AnybodyThank you very very much for your quick reaction, BR0kEN! That's great!