When creating a view that displays a summary when contextual filter is not present and a base path is set, the resulting page generates a fatal error for using $this when not in an object context which comes from line 280 of views.theme.inc [$tokens = $this->getArgumentTokens()]. There are actually 4 references to "$this" in the file and I'm assuming that the others will generate the same fatal error.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | summary_fatal-2685021-11.patch | 4.99 KB | lendude |
| #11 | summary_fatal-2685021-11-TEST_ONLY.patch | 3.05 KB | lendude |
| #7 | fatal_error_this_when-2685021-7.patch | 1.78 KB | cilefen |
Comments
Comment #2
cilefen commentedNice find. There is not a class to be seen in this file. I am bumping this to Major priority.
Comment #3
cilefen commentedComment #4
cilefen commentedComment #5
r0nn1ef commentedComment #6
cilefen commentedThis is just part of it. viewsTokenReplace() is a protected method on a views plugin. This needs test coverage.
Comment #7
cilefen commentedComment #8
r0nn1ef commentedThanks for the quick turn around on this. I've applied the patch in #7 and no longer receive the fatal error.
Comment #9
lendudeFix looks good, setting to 'needs work' for the tests.
Comment #10
andypostA test view to reproduce the issue
EDIT https://gist.github.com/andypost/ccb9fbf00298f49388a4
Comment #11
lendudeHere are some tests for this, as the tests will show, the fix in #7 solves the fatal but the extra arguments are not added to the base path in the summary, so all links in the summary just point to the base path.
Comment #14
lendudeNo idea if this is the right way to do this, but it works and turns the test green locally.
Added more tests and redid the ones in #11
Comment #15
andypostSuppose
<front>should be a route fallbackComment #16
lendude@andypost good point, updated.
Comment #17
lendudeBleh, forgot to update the comment
Comment #18
andypostLooks ready for me
Comment #19
dawehnerI always really like if we break things, and then add test coverage due to that.
Nitpick: I don't see why you would have to specify this type here, but nevermind.
Comment #20
lendudeClean up per #19, no idea why I stuck that in.
Comment #21
dawehnerOkay, cool!
Comment #22
alexpottCommitted 6748315 and pushed to 8.0.x, 8.1.x and 8.2.x. Thanks!
Comment #25
lendudeUhh no idea how this got to 'needs work' again, back to fixed.
Comment #27
lamp5Any plans to fix this on 8.3.x ??