Problem/Motivation

With groupblock enabled (2.x, but 3.x should have the same issue), when you create a new block content type, you get a error like this:

TypeError: groupblock_block_content_type_insert(): Argument #1 ($block_content_type) must be of type BlockContentType, Drupal\block_content\Entity\BlockContentType given in groupblock_block_content_type_insert() (line 21 of /opt/drupal/web/modules/contrib/groupblock/groupblock.module).

This is occurring because the typehint in groupblock_block_content_type_insert is not namespaced correctly with a use statement.

Steps to reproduce

1. Enable groupmenu
2. Create a new block content type and save
3. observe error screen and/or exception in log

Proposed resolution

Add use statemnt

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork groupblock-3413570

Command icon 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

godotislate created an issue. See original summary.

godotislate’s picture

Status: Active » Needs review

Put up MR:

  • Changed typehint to the interface
  • Added use statement for the interface
  • Added module dependency for drupal:block_content

LOBsTerr made their first commit to this issue’s fork.

  • LOBsTerr committed e5e4a308 on 3.x
    Issue #3413570 by LOBsTerr: Missing namespace for BlockContentType in...
lobsterr’s picture

Status: Needs review » Fixed

Thank you for your contribution

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.