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
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | views-preview-error-2505997-4.patch | 2.5 KB | peterpoe |
| after.png | 35.02 KB | olli | |
| before.png | 31.4 KB | olli | |
| views-preview-error.patch | 593 bytes | olli |
Comments
Comment #1
phantomvish commentedMakes sense, Patch works as expected. +1 rtbc
Comment #2
lendudeFix looks good, but needs a test.
Comment #4
peterpoe commentedTest here
Comment #5
peterpoe commentedSorry, here
Comment #6
lendudeManually tested this and fix is good.
Patch looks good to me now.
Comment #7
alexpottNice bug fix and test - thanks. Committed ff5ac65 and pushed to 8.0.x and 8.1.x. Thanks!