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.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | views-930928-9.patch | 461 bytes | dawehner |
| #7 | views-930928-7.patch | 427 bytes | tim.plunkett |
| #2 | 930928-7.patch | 4.68 KB | bojanz |
| #2 | 930928-6.patch | 3.68 KB | bojanz |
| #1 | 930928.patch | 4.69 KB | bojanz |
Comments
Comment #1
bojanz commentedHere's a patch.
Removes some trailing whitespace, and kills the IF.
Comment #2
bojanz commenteddereine 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).
Comment #3
dawehnermerlinofchaos might know why there is a if($query)
The rest looks fine
Comment #4
merlinofchaos commentedThe 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.
Comment #5
dawehnerSo i guess this is a won't fix.
Comment #6
merlinofchaos commentedWell I think we can still fix it so that we don't end up with uninitialized variables in that case.
Comment #7
tim.plunkettThe uninitialized $start is the only part of this that looks still valid.
Comment #8
tim.plunkettAssigning for review
Comment #9
dawehnerThanks for the patch! Committed to 7.x-3.x
Here is a patch for 6.x-3.x
Comment #10
tim.plunkettLooking good.
Comment #11
dawehnerThanks for the review!
Commmitted to 6.x-3.x