Download & Extend

Views preview uses the wrong query class name

Project:Drupal core
Version:8.x-dev
Component:views_ui.module
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)
Issue tags:Needs tests, VDC

Issue Summary

Attached patch fixes a couple bugs.

The views UI uses Database, but doesn't "use" it. This bug isn't ever found because we're checking for an instance of views_plugin_query_default, which is no longer the right class name. Both of these result in the query args not being replaced in the preview.

AttachmentSizeStatusTest resultOperations
views_ui_db_class_bug.patch963 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 46,042 pass(es).View details

Comments

#1

Status:active» needs review

#2

Issue tags:+VDC

#3

I have a feeling this needs tests...

#4

Priority:major» normal
Issue tags:-Needs tests

We need tests for so many things.

AttachmentSizeStatusTest resultOperations
core-1820332-4.patch2.68 KBIdlePASSED: [[SimpleTest]]: [MySQL] 46,380 pass(es).View details
core-1820332-4-test.patch1.74 KBIdleFAILED: [[SimpleTest]]: [MySQL] 46,387 pass(es), 2 fail(s), and 0 exception(s).View details

#5

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

The last submitted patch, core-1820332-4-test.patch, failed testing.

#6

Status:needs work» needs review

Proven that there is a bug.

#7

Status:needs review» needs work

Looks pretty good.

I will create a follow up issue for testing all views settings in the UI match the set variables.

+++ b/core/modules/views/lib/Drupal/views/Tests/UI/SettingsTest.phpundefined
@@ -91,6 +91,29 @@ function testEditUI() {
+    $this->assertFalse(strpos($xpath[0], 'db_condition_placeholder_0') !== FALSE, 'The placeholders in the views sql are not shown directly..');

We should just test for all placeholders here, not just the first?

Also, should this live in it's own method, like testUIPreview or something?

#8

Also, should this live in it's own method, like testUIPreview or something?

After looking the the testEditUI method, this seems to fit in there, as it tests most other parts of the edit form too.

#9

Status:needs work» needs review

Later we should enable the settings via config() and test the output, and just test that the settings form is saving the right config.

AttachmentSizeStatusTest resultOperations
drupal-1820332-7.patch2.66 KBIdlePASSED: [[SimpleTest]]: [MySQL] 46,394 pass(es).View details

#10

Status:needs review» reviewed & tested by the community

This is looking good.

#11

We use instanceof most everywhere else, let's do that here as well.

AttachmentSizeStatusTest resultOperations
vdc-1820332-11.patch2.67 KBIdlePASSED: [[SimpleTest]]: [MySQL] 46,403 pass(es).View details
interdiff.txt949 bytesIgnored: Check issue status.NoneNone

#12

Title:Db class name bug in views preview» Views preview uses the wrong query class name

#13

Status:reviewed & tested by the community» fixed

Makes sense, and comes with tests. Yay!

Committed and pushed to 8.x. Thanks!

#14

Status:fixed» closed (fixed)

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

nobody click here