Installing or upgrading Helper past 8.x-1.40 on Drupal 10 sites causes fatal PHP errors on the node edit form.

AssertionError: assert($formObject instanceof NodeForm) in assert() (line 41 of modules/contrib/helper/src/Hook/NodeHooks.php).

This is due to commit 085f945b (Alter node form author to display formatted name instead of raw username.) which was introduced in 8.x-1.41 and adds the NodeHooks class. This class uses Drupal\node\Form\NodeForm. However, prior to Drupal 11.2, that class has a different namespace: Drupal\node\NodeForm. See: #3517871: NodeForm and NodeTypeForm have moved to the Drupal\node\Form namespace for the change record.

Issue fork helper-3584162

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

jesss created an issue. See original summary.

dave reid’s picture

dave reid’s picture

Hmmmm, I think I might need to start separating out a new branch of Helper that tracks only Drupal 11 then, I'm not immediately sure how to support this.

dave reid’s picture

Can you please test out https://git.drupalcode.org/project/helper/-/merge_requests/78 to see if this resolves the issue for you? I'd be happy to commit and release if you can confirm.

jesss’s picture

That MR works for me. Thank you!

  • dave reid committed 56a65c11 on 8.x-1.x
    fix: #3584162 Fixed NodeHooks::alterNodeForm() assertion not compatible...
dave reid’s picture

Status: Active » 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.

fransheska tula’s picture

We tested the MR and can confirm that it is working as expected.

dave reid’s picture

Thanks all! I tagged the 8.x-1.47 release which has this fix.

Status: Fixed » Closed (fixed)

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