Error: Call to a member function setFormClass() on null in mercury_editor_entity_type_build() (line 658 of mercury_editor.module) /var/www/html/web/core/lib/Drupal/Core/Entity/EntityTypeManager.php(121)

Created on 30 August 2024, 5 months ago

Problem/Motivation

Can't install module. drush en -y mercury_editor

Error: Call to a member function setFormClass() on null in mercury_editor_entity_type_build() (line 658 of mercury_editor.module) /var/www/html/web/core/lib/Drupal/Core/Entity/EntityTypeManager.php(121)

Steps to reproduce

1. drush en -y mercury_editor

Proposed resolution

The reason of problem that setFormClass() called on null because entity type $entity_types['block_content'] not found.
For example, here is a list of some available entity types on my Drupal installation

array(73) {
  [0] => "block"
  [1] => "comment_type"
  [2] =>"comment"
  [3] => "config_pages_type"
  [4] =>"config_pages"
  [5] => "content_moderation_state"
  [6] => "crop"
  [7] =>"crop_type"
  [8] => "editor"
  [9] => "entity_browser"
  [10] => "environment_indicator"
  [11] =>"field_storage_config"
  [12] => "field_config"
  [13] =>"file"
  [14] =>"filter_format"
  [15] =>"group_type"
  [16] =>"group_relationship"
  [17] =>"group_config_wrapper"
  [18] =>"group"
  [19] =>"group_role"
  [20] =>"group_relationship_type"
  [21] =>"image_style"
  [22] =>"imageapi_optimize_pipeline"
  [23] =>"key_config_override"
  [24] => "key"
  [25] =>"configurable_language"
  [26] =>"language_content_settings"
  [27] =>"linkit_profile"
  ...
  [60] => "user_role"
  [61] =>"user"
  [62] =>"workflow"
  [63] =>"pathauto_pattern"
  [64] =>"view"
  [65] =>"paragraphs_type"
  [66] =>"paragraph"
  [67] =>"entity_form_mode"
  [68] =>"entity_view_mode"
  [69] =>"entity_view_display"
  [70] =>"entity_form_display"
  [71] => "date_format"
  [72] =>"base_field_override"

Attaching patch to fix this issue.

πŸ› Bug report
Status

Needs review

Version

2.2

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine oleksandr.s

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