Closed (fixed)
Project:
Views Field View
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Mar 2013 at 09:15 UTC
Updated:
13 Apr 2013 at 10:30 UTC
Jump to comment: Most recent file
Comments
Comment #1
derhasi commentedAnd there is the patch.
Comment #2
derhasi commentedComment #3
derhasi commentedA little simpler approach, that simply casts the values to an object.
$empty = TRUE might occur, when the views result is empty, @see views_plugin_display::render_area().
Comment #5
dawehner$values is either the current row (in case this is used as field) or a boolean saying: do we want to render the area, if it's empty. This logic doesn't seem to be implemented here. So what about checking for (empty($view->result) && $empty === FALSE) { return ''; } The casting casting logic here is not required anymore and we could just provide an empty stdClass, as casting an boolean is odd, sorry.
Comment #6
derhasi commentedOh, yes you might be right.
There's another solution that will handle the warning in a better way. In the case of an area handler, we do not need to touch the $values anyway. And in the case of empty === TRUE (for footer and header) nothing should be rendered at all?
Comment #8
dawehnerFirst: You are able to render a header/footer if there is an emtpy views result set, but even more important this method is called on empty areas, whch in this cause wouldn't be rendered at all. Glad to know that this is caught by the test coverage.
Comment #9
derhasi commentedAh, ok, then I misunderstood your previous comment.
So in that case, the following patch should be enough. Let's try it again ;)
Comment #11
derhasi commentedAh, sorry it will not work, due to the non-relative path. There is another patch.
btw: The above test failed due to a non-applicable test. As I saw in the code, the empty region is always called with $empty = FALSE, @see views_plugin_display::render_empty().
Comment #12
damiankloip commentedThe fix looks ok, maybe it would be good to add a couple of tests for this?
Comment #13
damiankloip commentedCommitted to 7.x. Let's just get this in for now. I tested it and doesn't break anything :)
Also I amended the comments for the patch.