Uninstall module page not working

Created on 12 November 2024, about 1 month ago

Hi,

I have upgraded group module from version 2.2 to 3.3. The upgrade went well. But the admin module uninstall page `/admin/modules/uninstall` is not working. I have tried the commands `drush cr` and `drush updb` but still no luck.

The error is

The website encountered an unexpected error. Try again later.

Drupal\Component\Plugin\Exception\PluginNotFoundException: The "group_content_type" entity type does not exist. in Drupal\Core\Entity\EntityTypeManager->getDefinition() (line 142 of core/lib/Drupal/Core/Entity/EntityTypeManager.php).

Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem::propertyDefinitions(Object) (Line: 590)
Drupal\Core\Field\BaseFieldDefinition->getPropertyDefinitions() (Line: 269)
Drupal\Core\Entity\Query\Sql\Tables->addField('type', 'INNER', NULL) (Line: 58)
Drupal\Core\Entity\Query\Sql\Condition->compile(Object) (Line: 177)
Drupal\Core\Entity\Query\Sql\Query->compile() (Line: 82)
Drupal\Core\Entity\Query\Sql\Query->execute() (Line: 91)
Drupal\group\UninstallValidator\GroupRelationshipUninstallValidator->hasRelationships('group_membership') (Line: 58)
Drupal\group\UninstallValidator\GroupRelationshipUninstallValidator->validate('group') (Line: 650)
Drupal\Core\Extension\ModuleInstaller->validateUninstall(Array) (Line: 99)
Drupal\Core\ProxyClass\Extension\ModuleInstaller->validateUninstall(Array) (Line: 161)
Drupal\system\Form\ModulesUninstallForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 536)
Drupal\Core\Form\FormBuilder->retrieveForm('system_modules_uninstall', Object) (Line: 284)
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: 638)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 68)
Drupal\simple_oauth\HttpMiddleware\BasicAuthSwap->handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->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: 53)
Asm89\Stack\Cors->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: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 741)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
πŸ› Bug report
Status

Active

Version

3.3

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom chandraraj

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

Comments & Activities

  • Issue created by @chandraraj
  • πŸ‡ΊπŸ‡ΈUnited States ljwilson

    I have the exact same issue. I tracked it down to two records in the key_value table which still have a reference to group_content_type instead of group_relationship. This sql finds them:

    SELECT * FROM key_value WHERE collection LIKE '%entity.definitions.installed%' AND VALUE LIKE '%group_content_type%'

    Fortunately I had another site where I had started with Group 3.x initially, so I just replaced the value field for those 2 records in the problem site's db with the ones from the "good" site.

    I did a compare on those values first, and it looked "safe" enough to make this change. Time will tell.

    ...jack

  • πŸ‡²πŸ‡ΎMalaysia muaz91 MY

    Having the same issue here. following

  • πŸ‡ΊπŸ‡ΈUnited States ljwilson

    A better fix might be from The "group_content_type" entity type does not exist error after upgrade from v2 to v3
    https://www.drupal.org/project/group/issues/3494298 πŸ› The "group_content_type" entity type does not exist error after upgrade from v2 to v3 Active

    I backed-out my db changes and applied the code from the above issue and it also fixes the uninstall error.

    To easily run the code referenced, I created a file update_field_storage.php in the group module folder with the following contents, and ran it with drush scr update_field_storage.php

    <?php
    
    use Drupal\Core\Entity\EntityDefinitionUpdateManagerInterface;
    use Drush\Drush;
    
    $field_def = \Drupal::entityDefinitionUpdateManager()->getFieldStorageDefinition('type', 'group_relationship');
    
    // Get the Symfony Console Output interface from Drush.
    $output = Drush::output();
    
    if ($field_def) {
        $field_def->setSetting('target_type', 'group_relationship');
        \Drupal::entityDefinitionUpdateManager()->updateFieldStorageDefinition($field_def);
    
        // Print success message to the console.
        $output->writeln('<info>Field storage definition updated successfully.</info>');
    } else {
        // Print error message to the console.
        $output->writeln('<error>Field storage definition not found.</error>');
    }

    ...jack

Production build 0.71.5 2024