I'm using IEF 8.x-1.0-beta1 with Drupal 8.4.0 in a "training" content type so users can add "training sessions" to it.

I chose the 'complex' widget. I was facing the error described in issue https://www.drupal.org/node/2901943 when trying to add a new "training session" within the "training" creation form.

Applying the patch provided in the issue queue above solved the problem.

However, I'm facing a very similar issue when the user clicks "Add a new node" but changes their mind and then click "Cancel": This triggers the following stack trace in the PHP error log (on screen it simply does not react much):

[Wed Oct 11 16:34:48.991255 2017] [:error] [pid 5687] [client 127.0.0.1:57874] TypeError: Argument 1 passed to Drupal\\Core\\Form\\FormState::setError() must be of the type array, null given, called in /var/www/html/mysite/www/core/lib/Drupal/Core/Field/WidgetBase.php on line 439 in /var/www/html/mysite/www/core/lib/Drupal/Core/Form/FormState.php on line 1093
#0 /var/www/html/mysite/www/core/lib/Drupal/Core/Field/WidgetBase.php(439): Drupal\\Core\\Form\\FormState->setError(NULL, Object(Drupal\\Core\\StringTranslation\\TranslatableMarkup))\n
#1 /var/www/html/mysite/www/core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php(255): Drupal\\Core\\Field\\WidgetBase->flagErrors(Object(Drupal\\Core\\Field\\FieldItemList), Object(Symfony\\Component\\Validator\\ConstraintViolationList), Array, Object(Drupal\\Core\\Form\\FormState))\n
#2 /var/www/html/mysite/www/core/lib/Drupal/Core/Entity/ContentEntityForm.php(260): Drupal\\Core\\Entity\\Entity\\EntityFormDisplay->flagWidgetsErrorsFromViolations(Object(Drupal\\Core\\Entity\\EntityConstraintViolationList), Array, Object(Drupal\\Core\\Form\\FormState))\n

[...]

Any idea what the problem could be?

Note: Tested IEF version "1.x-dev" too: Same issue.

Comments

pacproduct created an issue. See original summary.

pacproduct’s picture

Issue summary: View changes
Simon Georges’s picture

pacproduct’s picture