Getting error while uninstalling the module.

Created on 8 August 2023, 11 months ago
Updated 18 October 2023, 8 months ago

Problem/Motivation

When I try to uninstall this module, I am getting this error.
The website encountered an unexpected error. Please try again later.

Error: Call to undefined function drupal_uninstall_schema() in find_external_links_uninstall() (line 17 of modules/find_external_links/find_external_links.install).
call_user_func_array(Object, Array) (Line: 400)
Drupal\Core\Extension\ModuleHandler->invoke('find_external_links', 'uninstall', Array) (Line: 467)
Drupal\Core\Extension\ModuleInstaller->uninstall(Array, 1) (Line: 91)
Drupal\Core\ProxyClass\Extension\ModuleInstaller->uninstall(Array) (Line: 174)
Drupal\system\Form\ModulesUninstallConfirmForm->submitForm(Array, Object)
call_user_func_array(Array, Array) (Line: 114)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 52)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 597)
Drupal\Core\Form\FormBuilder->processForm('system_modules_uninstall_confirm_form', Array, Object) (Line: 325)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 583)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 166)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 74)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Steps to reproduce

Uninstall the module, you will get the error.

Proposed resolution

Change the required things.

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia Nishant

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Nishant
  • Issue was unassigned.
  • Status changed to Needs review 11 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Nishant

    Fixed the above issue and provided solution with patch.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Rajan Kumar

    Rajan Kumar โ†’ made their first commit to this issueโ€™s fork.

  • @rajan-kumar opened merge request.
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Rajan Kumar

    I have review & merge above patch.

  • Status changed to Fixed 11 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia shaika-hassan

    To uninstall a table created using the schema API use the
    \Drupal::database()->schema()->dropTable() method directly.

    for example:
    employee_uninstall() function: function employee_uninstall() {
    // Remove the employee_info table.
    \Drupal::database()->schema()->dropTable('employee_info');
    }
    With this code you would no longer see the "Call to undefined function drupal_uninstall_schema()" error, and it will correctly remove the 'employee_info' table when the module is uninstalled.

Production build 0.69.0 2024