- Issue created by @djdevin
- π©πͺGermany jurgenhaas Gottmadingen
Thanks @djdevin for reporting this. Had a quick look and it seems that PHP 8.1 with its strict type handling of variables is identifying an issue here that we had not seen before.
The hook from Drupal core is defined like this:
function hook_entity_prepare_form(EntityInterface $entity, $operation, FormStateInterface $form_state)
Our implementation in ECA, however, looks like this:
public function prepareForm(EntityInterface $entity, string $operation, FormStateInterface $form_state)
The small difference is that we declare the string type for the operation argument, as we assumed that an operation is always given. Turns out, that assumption is not correct.
To fix this, we need to go through the code and allow NULL values everywhere the operation is being referenced. Unfortunately, I can't do that today but will get back to this tomorrow - unless somebody else will have jumped in before then and provided a MR to fix this.
- πΊπΈUnited States djdevin Philadelphia
Sorry, I should have mentioned this is with PHP 7.4. But it fails on PHP 8.1 too.
$operation is actually NULL being passed in, not sure why yet.
- @jurgenhaas opened merge request.
- Status changed to Needs review
over 1 year ago 12:31pm 22 February 2023 - π©πͺGermany jurgenhaas Gottmadingen
It wasn't quite as bad. @djdevin please give it a try and let us know if that fixes your issue.
- Status changed to RTBC
over 1 year ago 9:53am 1 March 2023 -
jurgenhaas β
committed d3f9589d on 1.2.x
Issue #3343459 by jurgenhaas, djdevin, danielspeicher: TypeError:...
-
jurgenhaas β
committed d3f9589d on 1.2.x
-
jurgenhaas β
committed a9b52be3 on 1.1.x
Issue #3343459 by jurgenhaas, djdevin, danielspeicher: TypeError:...
-
jurgenhaas β
committed a9b52be3 on 1.1.x
-
jurgenhaas β
committed 88f4f2e4 on 1.0.x
Issue #3343459 by jurgenhaas, djdevin, danielspeicher: TypeError:...
-
jurgenhaas β
committed 88f4f2e4 on 1.0.x
- Status changed to Fixed
over 1 year ago 10:22am 1 March 2023 - π©πͺGermany jurgenhaas Gottmadingen
Thanks @danielspeicher for your review, I've merged into 1.2 and back ported into 1.1 and 1.0
Automatically closed - issue fixed for 2 weeks with no activity.