Cannot save Page in XB when content_moderation is installed

Created on 14 January 2025, 6 days ago

Overview

I think this is in the page builder. When saving, I get an error:

{
    "message": "Drupal\\content_moderation\\EntityTypeInfo::isModeratedEntityEditForm(): Argument #1 ($form_object) must be of type Drupal\\Core\\Form\\FormInterface, null given, called in \/var\/www\/html\/docroot\/core\/modules\/content_moderation\/src\/EntityTypeInfo.php on line 305"
}

The form state isn't returning a form object

  public function entityPrepareForm(EntityInterface $entity, $operation, FormStateInterface $form_state) {
    /** @var \Drupal\Core\Entity\EntityFormInterface $form_object */
    $form_object = $form_state->getFormObject();

    if ($this->isModeratedEntityEditForm($form_object) && !$entity->isNew()) {

Invoked by

function content_moderation_entity_prepare_form(EntityInterface $entity, $operation, FormStateInterface $form_state) {
  \Drupal::service('class_resolver')
    ->getInstanceFromDefinition(EntityTypeInfo::class)
    ->entityPrepareForm($entity, $operation, $form_state);
}

Proposed resolution

User interface changes

πŸ› Bug report
Status

Active

Version

0.0

Component

Page

Created by

πŸ‡ΊπŸ‡ΈUnited States mglaman WI, USA

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