Problem/Motivation
Curly braces are missing around $view->storage-id in the views query exception (in Sql.php). Without the correct error message it's hard to figure out what is broken.
Proposed resolution
Fix this issue asap.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #27 | error_in_case_of_a-2547357-27-interdiff.txt | 1.48 KB | sasanikolic |
| #27 | error_in_case_of_a-2547357-27.patch | 3.56 KB | sasanikolic |
| #21 | error_in_case_of_a-2547357-21-interdiff.txt | 719 bytes | sasanikolic |
| #21 | error_in_case_of_a-2547357-21.patch | 3.54 KB | sasanikolic |
| #19 | error_in_case_of_a-2547357-19-interdiff.txt | 719 bytes | sasanikolic |
Comments
Comment #2
sasanikolic commentedHere is the fix.
Comment #3
alexpottThe fix looks good - anyway to test this?
Comment #4
timmillwoodPatch in #2 looks good to me, but wondering if this is slightly more readable.
Comment #5
sasanikolic commentedWe could test it with having a invalid SQL query that breaks views.
Comment #6
dawehnerUps things happen, but now we will add test coverage so we actually gained something from breaking it :)
Comment #7
sasanikolic commentedComment #8
sasanikolic commentedHere is the test for the exception.
Comment #9
timmillwoodComment #10
alexpottI don't understand how the test is testing this code. Running the test without this code does not fail.
Comment #11
juanse254 commentedPlease provide a TEST-Only with the test so we know that the test is actually failing without the fix.
Comment #12
sasanikolic commented1.) Reverted the exception in Sql.php, because it returns an invalid php syntax error,
2.) Made the query break in the test
3.) Now we're checking that the view label and id are in there as expected in the thrown exception.
Comment #13
sasanikolic commentedHere is the test-only patch.
Comment #15
edurenye commentedSeems fine for me.
Next time remember to add the -test_only suffix in the name of the test only patch.
Comment #16
berdirYes, #4 was wrong, this is *not* php array access. It's about displaying this string: "My super view[my_super_view_id]".
I don't think that such a @see works? There is no function that it can point to, if anything, then we need to make it a reference to the plugin class?
We are not testing the exception filter here. We are testing the views exception handling, so this should be called ViewsSqlExceptionTest or something like that. With a matching comment.
Do we really need the views_ui module to be enabled here?
This would then be called testSqlExeption()
Comment is outdated and I actually think those three lines are useless, we don't need to test that the plugin exists here.
Add a more specific comment here, say that you add a filter that will result in an invalid query.
We don't need all this.
Comment #17
sasanikolic commentedChanges for the comment(s) above.
Comment #18
dawehnerIt is great that we have test coverage now.
We could just use {@inheritdoc}
Comment #19
sasanikolic commentedAdded the
@inheritdocto the test.Comment #21
sasanikolic commentedRebased.
Comment #24
sasanikolic commentedComment #25
juanse254 commentedEverything seems to work accordingly.
Comment #26
mbovan commentedNot used.
Typo and missing doc block.
Missing short class description.
Comment #27
sasanikolic commentedFixes for the comment above.
Comment #28
berdirLooks good now I think.
Comment #29
alexpottThis issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed b833f73 and pushed to 8.0.x. Thanks!