Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
views.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
26 Feb 2015 at 18:56 UTC
Updated:
24 Mar 2015 at 12:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dawehnerGood catch!!! Do you think we should write a test here?
Comment #2
devpreview commentedI tried to write the tests but I don't understand how to write them.
Sorry.
Comment #4
dawehnerSo what you would do is to write some code which calls out to
This itself might try to load the view itself, see
$this->viewStorage->load($view_id)In order for that to work, you have to mock the behaviour of the entity storage:
Feel free to ping me in IRC.
Comment #5
devpreview commentedPatch with tests.
Thanks for help from IRC!
Comment #6
devpreview commentedComment #7
dawehnerAwesome work
It would be great to add a one-line documentation explaining why we need this check here.
Comment #8
devpreview commentedSorry, I do not speak English.
This comment will be correct?
Comment #9
dawehnerMaybe try something like: // Ensure to not call the current view, as it would result into a infinite recursion.
Comment #10
devpreview commentedThen
"exists insert view id" for old "if ($view_id)" condition.
Comment #11
devpreview commentedUpdated one-line documentation
Comment #12
dawehnerSorry for the endless nitpicking here ... i think its pointless to describe what the code is doing but rather we should describe why (which is doing the second part of the sentence).
I would vote for: "Don't call the current view, as it would result into an infinite recursion."
Comment #13
devpreview commentedThank you for your help!
I don't think it's nitpicking since it makes the code better :)
Comment #14
dawehnerThank you!
Comment #15
alexpottGreat catch and nice patch. This 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 0943b23 and pushed to 8.0.x. Thanks!