Commit 58bd5a3a authored by alexpott's avatar alexpott

Issue #2505997 by olli, peterpoe, Lendude: User error: "preview" is an invalid render array key

parent a172ab5b
langcode: en
status: true
dependencies:
module:
- user
id: test_preview_error
label: test_preview_error
module: views
description: ''
tag: ''
base_table: views_test_data
base_field: id
core: 8.x
display:
default:
display_plugin: default
id: default
display_title: Master
position: null
display_options:
row:
type: fields
fields: { }
......@@ -21,7 +21,7 @@ class PreviewTest extends UITestBase {
*
* @var array
*/
public static $testViews = array('test_preview', 'test_pager_full', 'test_mini_pager');
public static $testViews = array('test_preview', 'test_preview_error', 'test_pager_full', 'test_mini_pager');
/**
* Tests contextual links in the preview form.
......@@ -230,6 +230,18 @@ public function testPreviewAdditionalInfo() {
$this->assertRaw('css/views_ui_test.test.css', 'Attached CSS asset found.');
}
/**
* Tests view validation error messages in the preview.
*/
public function testPreviewError() {
$this->drupalGet('admin/structure/views/view/test_preview_error/edit');
$this->assertResponse(200);
$this->drupalPostForm(NULL, $edit = array(), t('Update preview'));
$this->assertText('Unable to preview due to validation errors.', 'Preview error text found.');
}
/**
* Get the preview form and force an AJAX preview update.
*
......
......@@ -818,7 +818,7 @@ public function renderPreview($display_id, $args = array()) {
drupal_set_message($error, 'error');
}
}
$preview = t('Unable to preview due to validation errors.');
$preview = ['#markup' => t('Unable to preview due to validation errors.')];
}
// Assemble the preview, the query info, and the query statistics in the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment