Can't create new content type. Error: Call to a member function getTargetBundle() on null in entity_draft_entity_edit_form_alter() (line 133 of modules/contrib/entity_draft/entity_draft.module).

Created on 10 November 2022, about 2 years ago
Updated 31 July 2023, over 1 year ago

Problem/Motivation

Whenever I try to access this URL(/admin/structure/types/add) to add new content type, I am getting following error:

Error: Call to a member function getTargetBundle() on null in entity_draft_entity_edit_form_alter() (line 133 of modules/contrib/entity_draft/entity_draft.module).

entity_draft_entity_edit_form_alter() (Line: 123)
entity_draft_form_alter() (Line: 562)
Drupal\Core\Extension\ModuleHandler->alter() (Line: 835)
Drupal\Core\Form\FormBuilder->prepareForm() (Line: 279)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)
Drupal\Core\Controller\FormController->getContentResult()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 564)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 159)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->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: 23)
Stack\StackedHttpKernel->handle() (Line: 709)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Steps to reproduce

Drupal version: 9.4.8
Module version: 2.0.5

🐛 Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

🇮🇳India vikrantd506

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

Comments & Activities

Not all content is available!

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

Production build 0.71.5 2024