What are the steps required to reproduce the bug?

1. Create a new content type.
2. Set the body field to required.
3. Add another field like an image, or multiple entity reference.
4. Add a new node of content type and upload an image while leaving the body field empty.

What behavior were you expecting?

The image just being uploaded, or a extra entity reference field being added.

What happened instead?

The image wasn't uploaded, the ajax request returned empty, but when you do fill in the body field, the image upload does work.

Logs

When it fails, the ajax request returns empty, and gives the error I attached in a screenshot from chrome devtools.

In dblog i get 3 errors, first one comes first.

Notice: Undefined offset: 0 in Drupal\text\Plugin\Field\FieldWidget\TextareaWithSummaryWidget->errorElement() (line 95 of /webdata/www/core/modules/text/src/Plugin/Field/FieldWidget/TextareaWithSummaryWidget.php).

Notice: Undefined index: in Drupal\text\Plugin\Field\FieldWidget\TextareaWithSummaryWidget->errorElement() (line 95 of /webdata/www/core/modules/text/src/Plugin/Field/FieldWidget/TextareaWithSummaryWidget.php).

Recoverable fatal error: Argument 1 passed to Drupal\Core\Form\FormState::setError() must be of the type array, null given, called in /webdata/www/core/lib/Drupal/Core/Field/WidgetBase.php on line 449 and defined in Drupal\Core\Form\FormState->setError() (line 1144 of /webdata/www/core/lib/Drupal/Core/Form/FormState.php>).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

JanLaureys created an issue. See original summary.

JanLaureys’s picture

Issue summary: View changes
tim.plunkett’s picture

Confirmed! This is related to violation property paths being unreliable.
Here is a temporary fix.

tim.plunkett’s picture

tim.plunkett’s picture

Component: forms system » text.module

The last submitted patch, 4: 2553983-textarea-4-FAIL.patch, failed testing.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

xjm’s picture

Priority: Normal » Major

Since this involves unpredictable fatal errors for end users after the site builder assembles a fully supported data model in the UI alone for a common usecase, that is a strong case for this issue to be considered as a major.

alexpott’s picture

Should this be part of the WidgetBase implementation - given other issues like #2614250: Number widget validation can break AJAX actions. Or is that what #2027059: Improve the documentation of WidgetBase::errorElement() for mapping violation property paths to form elements is trying to do. We seem to have a number of issues in the this area.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

amateescu’s picture

Status: Needs review » Closed (duplicate)