- Issue 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 toFALSE
(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.