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.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | mercury_editor-call_setformclass_on_null-3471183-2.patch | 1.73 KB | oleksandr.s |
Issue fork mercury_editor-3471183
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
oleksandr.s commentedComment #3
oleksandr.s commentedComment #6
anna d commentedFaced with same error during module installation.
Created MR with #2 patch.
Comment #7
anna d commentedComment #10
sethhill commentedComment #11
sethhill commentedReplicated the issue and solution. MR looks good. Thank you!