Loading core/modules/views/tests/modules/views_test_config/test_views/views.view.test_preview_error.yml 0 → 100644 +23 −0 Original line number Diff line number Diff line 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: { } core/modules/views_ui/src/Tests/PreviewTest.php +13 −1 Original line number Diff line number Diff line Loading @@ -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. Loading Loading @@ -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. * Loading core/modules/views_ui/src/ViewUI.php +1 −1 Original line number Diff line number Diff line Loading @@ -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 Loading Loading
core/modules/views/tests/modules/views_test_config/test_views/views.view.test_preview_error.yml 0 → 100644 +23 −0 Original line number Diff line number Diff line 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: { }
core/modules/views_ui/src/Tests/PreviewTest.php +13 −1 Original line number Diff line number Diff line Loading @@ -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. Loading Loading @@ -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. * Loading
core/modules/views_ui/src/ViewUI.php +1 −1 Original line number Diff line number Diff line Loading @@ -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 Loading