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

merlinofchaos’s picture

If 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?

yched’s picture

Yeah, 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 :-)

yched’s picture

Side 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.

merlinofchaos’s picture

Ahh, so the default implementation merely needs to return TRUE. Easy enough.

yched’s picture

Er... yes, probably :-)

merlinofchaos’s picture

Status: Active » Fixed

Fixed in cvs. Thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.