In the execute() method, we check if($query), even though it's always true (db_select always returns an object).
And after that if, we do $view->execute_time = microtime(TRUE) - $start;, which can't be right since $start is declared in the IF block, so if the IF condition was false, we'd have no $start defined.

This is a cosmetic issue.

Comments

bojanz’s picture

Status: Active » Needs review
StatusFileSize
new4.69 KB

Here's a patch.

Removes some trailing whitespace, and kills the IF.

bojanz’s picture

Version: 7.x-3.x-dev » 6.x-3.x-dev
StatusFileSize
new3.68 KB
new4.68 KB

dereine nicely spotted that this is true for 6.x-3.x too.

So, here are patches for 6.x-3.x and 7.x-3.x (fixed one more leading whitespace occurence).

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

merlinofchaos might know why there is a if($query)

The rest looks fine

merlinofchaos’s picture

Status: Reviewed & tested by the community » Needs work

The if($query) exists because it is possible for a view to generate no query at all in some rare circumstances. If there is no $query obviously no query should be run.

dawehner’s picture

So i guess this is a won't fix.

merlinofchaos’s picture

Well I think we can still fix it so that we don't end up with uninitialized variables in that case.

tim.plunkett’s picture

Version: 6.x-3.x-dev » 7.x-3.x-dev
Status: Needs work » Needs review
StatusFileSize
new427 bytes

The uninitialized $start is the only part of this that looks still valid.

tim.plunkett’s picture

Assigned: Unassigned » dawehner

Assigning for review

dawehner’s picture

Version: 7.x-3.x-dev » 6.x-3.x-dev
StatusFileSize
new461 bytes

Thanks for the patch! Committed to 7.x-3.x

Here is a patch for 6.x-3.x

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community

Looking good.

dawehner’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the review!

Commmitted to 6.x-3.x

Status: Fixed » Closed (fixed)

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