Drupal 11 compatability

Created on 12 June 2025, 24 days ago

Problem/Motivation

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

📌 Task
Status

Active

Version

2.0

Component

Code

Created by

🇳🇿New Zealand ericgsmith

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @ericgsmith
  • Merge request !15Drupal 11 compatability → (Open) created by ericgsmith
  • 🇳🇿New Zealand ericgsmith

    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

    Change record: https://www.drupal.org/node/3517871

    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 login 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.

Production build 0.71.5 2024