Problem/Motivation

In EntityTypeFormHelper::processVariables there's following part:

if (!$formObject instanceof EntityForm) {
   return;
}

This leads to problems with e.g. the form_decorator (https://www.drupal.org/project/form_decorator) and a node type's form, where the 'Behavior settings' vertical tab suddenly vanishes. This is because, when decorating a form via form_decorator, the form class changes and (in my case) is not an instance of EntityForm anymore.

Steps to reproduce

Install form_decorator and decorate e.g. a node_type form of an entity, where entity_type_behaviors live -- the behaviors tab will vanish.

Proposed resolution

As, anyways, it's OOP's best practice to check against an Interface (if exists), just do
instanceof EntityFormInterface
instead of
instanceof EntityForm

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

drupatz created an issue. See original summary.

drupatz’s picture

Status: Active » Needs review

  • jeroent committed 647a24ab on 2.1.x authored by drupatz
    [#3543066] fix: Insufficient instance check: instanceof EntityForm
    
    By:...
jeroent’s picture

Status: Needs review » Fixed

Merged to 2.1.x. Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

  • jeroent committed 647a24ab on 2.0.x authored by drupatz
    [#3543066] fix: Insufficient instance check: instanceof EntityForm
    
    By:...

Status: Fixed » Closed (fixed)

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