Issue #3629888: Node form crashes when a Gutenberg content type has no text field

Closes https://www.drupal.org/project/gutenberg/issues/3629888

Drupal 11.3+ no longer adds a body field to new content types, and the node form of a Gutenberg content type without a formatted text field crashed in gutenberg_form_node_form_alter() ("Field is unknown").

  • GutenbergContentTypeManager::hasTextField() checks for a field with a text format, like UtilsController::getEntityTextFields(). Without one, _gutenberg_is_gutenberg_enabled() (and the node.add check of GutenbergElementInfoAlter) returns FALSE, so the node form falls back to the default form.
  • The Manage Gutenberg tab shows a warning while Gutenberg is enabled and the content type has no formatted text field, with a link to Manage fields. The content type add form shows it as a message.
  • ContentTypeEditTest::testContentTypeWithoutTextField() covers both.

Merge request reports

Loading
Loading