This issue is related to Issue #3081826: Block is not available. After creating and placing a D8 Block implementation of the Zendesk form, I discovered this error:

The website encountered an unexpected error. Please try again later.
TypeError: Argument 3 passed to Drupal\zendesk_forms\Form\ZendeskSupportForm::__construct() must be an instance of Egulias\EmailValidator\EmailValidatorInterface, instance of Drupal\Component\Utility\EmailValidator given, called in /app/web/modules/contrib/zendesk_forms/src/Form/ZendeskSupportForm.php on line 81 in Drupal\zendesk_forms\Form\ZendeskSupportForm->__construct() (line 64 of modules/contrib/zendesk_forms/src/Form/ZendeskSupportForm.php).

It appears the Block is providing the wrong type of validator to the Form. To recreate: apply parent issue patch #5

Comments

ellenoise created an issue. See original summary.

joachim’s picture

I wonder if this is a change in Drupal core? I was developing this on 8.6.

ellenoise’s picture

That's quite possible, I'm developing on Drupal 8.7.

joachim’s picture

Ah yes this looks like it: https://www.drupal.org/node/2997196

Egulias\EmailValidator\EmailValidatorInterface no longer exists in egulias/email-validator, which was upgraded for 8.7 in #2755401: Upgrade EmailValidator to 2.x:

-        "egulias/email-validator": "^1.2",
+        "egulias/email-validator": "^2.0",

There's a new interface we should be typehinting on -- see https://www.drupal.org/node/2997196

joachim’s picture

Status: Active » Fixed

Fixed, and I've set the minimum core version to 8.7, as the interface we're typehinting on now doesn't exist in prior versions.

  • joachim committed e4b1a69 on 8.x-1.x
    Issue #3082377 by ellenoise, joachim: Fixed crash on 8.7.x due to core's...

Status: Fixed » Closed (fixed)

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