RevisionableEntityBundleInterface required in Drupal\og_ui\BundleEntityFormAlter::getEntityBundle()

Created on 7 November 2024, 6 months ago

Problem/Motivation

When editing a custom entity without RevisionableEntityBundleInterface this error occurs:

The website encountered an unexpected error. Try again later.

TypeError: Drupal\og_ui\BundleEntityFormAlter::getEntityBundle(): Return value must be of type Drupal\Core\Entity\RevisionableEntityBundleInterface, Drupal\custom_resource\Entity\ResourceType returned in Drupal\og_ui\BundleEntityFormAlter::getEntityBundle() (line 228 of modules/contrib/og/og_ui/src/BundleEntityFormAlter.php).

Drupal\og_ui\BundleEntityFormAlter->addGroupType() (Line: 74) Drupal\og_ui\BundleEntityFormAlter->formAlter() (Line: 33) og_ui_form_alter() (Line: 552) Drupal\Core\Extension\ModuleHandler->alter() (Line: 834) Drupal\Core\Form\FormBuilder->prepareForm() (Line: 285) Drupal\Core\Form\FormBuilder->buildForm() (Line: 73) Drupal\Core\Controller\FormController->getContentResult() (Line: 39) Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult() call_user_func_array() (Line: 123) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 638) Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181) Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76) Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53) Drupal\Core\StackMiddleware\Session->handle() (Line: 48) Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28) Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 106) Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85) Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48) Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51) Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36) Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51) Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 741) Drupal\Core\DrupalKernel->handle() (Line: 19)

Steps to reproduce

  • Create a custom entity type that isn't revisionable
  • Enable og_ui
  • Visit the custom entity types edit form

Proposed resolution

If it's needed, check and bail before altering the form.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.0

Component

og-ui

Created by

🇨🇦Canada joelpittet Vancouver

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024