Closed (fixed)
Project:
Views (for Drupal 7)
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Mar 2008 at 17:12 UTC
Updated:
1 Apr 2008 at 15:52 UTC
When the view has exposed filters, the query() method for handlers isn't called, which breaks the query and issues lots of warnings.
Seems to be something around the 'continue;' part in view::_build(),
OTOH, it seems strange that it's not been reported before...
Comments
Comment #1
merlinofchaos commentedIf an exposed filter is set to 'optional' and it received no input, accept_exposed_input() should return FALSE which is informing the builder NOT to run the query() method.
Essentially, this is a filter recusing itself from the view based upon input (or a lack of input). So the question is: Why would this generate warnings?
Comment #2
yched commentedYeah, but that bit of code in _build() is executed for fields and sorts as well.
No field or sort handler currently implement accept_exposed_input(), and the default method in views_handler class is empty, so the test is always false and $array[$id]['handler']->query(); is never called for fields and sorts when a filter is exposed.
Tested with a simple view that just lists node titles, with an exposed filter on node type. No buggy CCK code in there :-)
Comment #3
yched commentedSide note : the warnings are then (once per node and per field)
notice: Undefined property: stdClass::$unknown in D:\Babou\Sites en dev\htdocs\drupal_test_6\sites\all\modules\views\modules\node.views.inc on line 299.
That's views_handler_field_node::render(), because $this->field_alias hasn't been set.
Comment #4
merlinofchaos commentedAhh, so the default implementation merely needs to return TRUE. Easy enough.
Comment #5
yched commentedEr... yes, probably :-)
Comment #6
merlinofchaos commentedFixed in cvs. Thanks!
Comment #7
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.