I get this error when trying to save inline entity that is not passing validation:

Recoverable fatal error: Argument 1 passed to Drupal\Component\Utility\NestedArray::getValue() must be of the type array, null given, called in /srv/http/pubtool/docroot/core/lib/Drupal/Core/Field/WidgetBase.php on line 403 and defined in Drupal\Component\Utility\NestedArray::getValue() (line 74 of /srv/http/pubtool/docroot/core/lib/Drupal/Component/Utility/NestedArray.php).

It seems that this happens since we don't add complete form to child form state.

Comments

slashrsm created an issue. See original summary.

subhojit777’s picture

I am getting this error too while adding commerce product #2600400: Error while creating product

subhojit777’s picture

Validation errors appear if you enable devel module. Strange!!

subhojit777’s picture

Status: Active » Needs work
StatusFileSize
new40.8 KB
new43.77 KB

I would like to contribute to this thread (code-wise). I have tried to debug the issue, but was unable to find the source of the problem. One thing I saw is that the validation works if I enable devel module.

Suppose I already have a SKU with code PROD-1 in my system.

Without devel module enabled:

With devel module enabled:

Not sure what is there inside devel module that is causing this. If anyone has ANY idea please share, I would like to help to fix this issue.

slashrsm’s picture

Status: Needs work » Needs review
StatusFileSize
new4.39 KB
new3.67 KB

This fixes it in my environment.

The last submitted patch, 5: 2597710_5.patch, failed testing.

The last submitted patch, 5: 2597710_5.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 5: 2597710_5_TEST_ONLY.patch, failed testing.

The last submitted patch, 5: 2597710_5_TEST_ONLY.patch, failed testing.

The last submitted patch, 5: 2597710_5_TEST_ONLY.patch, failed testing.

The last submitted patch, 5: 2597710_5_TEST_ONLY.patch, failed testing.

The last submitted patch, 5: 2597710_5_TEST_ONLY.patch, failed testing.

The last submitted patch, 5: 2597710_5.patch, failed testing.

The last submitted patch, 5: 2597710_5.patch, failed testing.

slashrsm’s picture

Status: Needs work » Needs review
StatusFileSize
new4.39 KB

Reroll.

slashrsm’s picture

StatusFileSize
new4.38 KB
new1.09 KB

Another nitpik.

The last submitted patch, 15: 2597710_13.patch, failed testing.

The last submitted patch, 15: 2597710_13.patch, failed testing.

The last submitted patch, 15: 2597710_13.patch, failed testing.

The last submitted patch, 15: 2597710_13.patch, failed testing.

The last submitted patch, 15: 2597710_13.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 16: 2597710_14.patch, failed testing.

bojanz’s picture

Looks good to me.

slashrsm’s picture

Status: Needs work » Fixed

Committed. Thank you for the review.

  • slashrsm committed 0e53279 on 8.x-1.x
    Issue #2597710 by slashrsm: Fatals in validation of inline form
    

Status: Fixed » Closed (fixed)

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