"The default OG membership type cannot be deleted" on uninstall

Created on 8 January 2022, almost 3 years ago
Updated 14 February 2023, almost 2 years ago

The Problem is simply that the module don't allow me to uninstall it. When i try to uninstall it this exception comes up:

Exception: The default OG membership type cannot be deleted. in Drupal\og\Entity\OgMembershipType->delete() (line 105 of modules/og/src/Entity/OgMembershipType.php).

When i try to delete the default membership type on my own, the result is a permission denied response. (even with user1)

πŸ› Bug report
Status

RTBC

Component

og.module

Created by

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

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

    Confirming that I got nothing but a WSOD installing on 9.5.1. And the patch in #6 worked for me.

    Can we please get this patch merged. It would be nice to be able to test this on an install, to see where OG is at and not have the hassle of it refusing to uninstall.

  • πŸ‡§πŸ‡·Brazil barone Belo Horizonte

    Confirming I just had this issue uninstalling the latest OG version, 8.x-1.0-alpha10 and Drupal 10.1.4. Here's the complete error message:

    The website encountered an unexpected error. Please try again later.
    
    Exception: The default OG membership type cannot be deleted. in Drupal\og\Entity\OgMembershipType->delete() (line 105 of modules/contrib/og/src/Entity/OgMembershipType.php).
    Drupal\Core\Config\ConfigManager->uninstall('module', 'og') (Line: 470)
    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: 592)
    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: 182)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
    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)
  • πŸ‡ΊπŸ‡¦Ukraine rsych

    Hi, can you release the fix from #5 comment?

  • First commit to issue fork.
  • πŸ‡¨πŸ‡¦Canada joelpittet Vancouver

    Thanks I tweaked and merged this quick fix, seems reasonable assumption

  • πŸ‡¨πŸ‡¦Canada joelpittet Vancouver
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024