Problem/Motivation

Tests currently failing on 11.x - module needs to be compatible.

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

ericgsmith created an issue. See original summary.

ericgsmith’s picture

Status: Active » Needs review

Ready for review.

Module was broken on 11.x after the NodeForm class has moved namespace: Drupal\node\NodeForm is now Drupal\node\Form\NodeForm

The CR doesn't seem to imply we should need to do anything for BC as the issue references the use of the deprecation class loader. However - autoloading does not apply when we are type checking - i.e when we do instanceof it fails. And not fails like throws an error, it fails in that $form_object instanceof NodeForm evaluates to FALSE (as the class doesn't exist) and silently moves on.

Calling class_exists will trigger the autoloader and return to normal functionality (i.e allow this to work with 10.x and 11.x) but seeing as this is explicitly marked as an @internal class we shouldn't be using it at all.

Given all the logic was within an if statement that checked it was a node form, I've just changed to use the node form base form alter hook.

ericgsmith’s picture

Status: Needs review » Fixed

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.

Status: Fixed » Closed (fixed)

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