Problem/Motivation

If there's a validation error in view's edit form, the following error is logged:
User error: "preview" is an invalid render array key in Drupal\Core\Render\Element::children() (line 101 of core/lib/Drupal/Core/Render/Element.php).

Steps to reproduce:
1. Edit front page view
2. Change the "Show" setting from content to fields
3. Click preview

Expected: You should see a message 'Unable to preview due to validation errors.'.

Actual: No message.

Proposed resolution

Remaining tasks

User interface changes

API changes

Comments

phantomvish’s picture

Makes sense, Patch works as expected. +1 rtbc

lendude’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

Fix looks good, but needs a test.

dpopdan queued views-preview-error.patch for re-testing.

peterpoe’s picture

Priority: Minor » Normal
Status: Needs work » Needs review
Issue tags: -Needs tests

Test here

peterpoe’s picture

StatusFileSize
new2.5 KB

Sorry, here

lendude’s picture

Status: Needs review » Reviewed & tested by the community

Manually tested this and fix is good.

Patch looks good to me now.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Nice bug fix and test - thanks. Committed ff5ac65 and pushed to 8.0.x and 8.1.x. Thanks!

  • alexpott committed 58bd5a3 on 8.1.x
    Issue #2505997 by olli, peterpoe, Lendude: User error: "preview" is an...

  • alexpott committed ff5ac65 on
    Issue #2505997 by olli, peterpoe, Lendude: User error: "preview" is an...

Status: Fixed » Closed (fixed)

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