Commit b8129e5b authored by das-peter's avatar das-peter Committed by tim.plunkett
Browse files

Issue #1368508 by tim.plunkett, das-peter: Added Document and enforce nummeric...

Issue #1368508 by tim.plunkett, das-peter: Added Document and enforce nummeric array keys starting at 0 for ->result.
parent 5a322ffc
......@@ -96,7 +96,13 @@ class View extends ViewsDbObject {
var $use_ajax = FALSE;
// Where the results of a query will go.
/**
* Where the results of a query will go.
*
* The array must use a numeric index starting at 0.
*
* @var array
*/
var $result = array();
// May be used to override the current pager info.
......@@ -1140,6 +1146,9 @@ function execute($display_id = NULL) {
}
else {
$this->query->execute($this);
// Enforce the array key rule as documented in
// views_plugin_query::execute().
$this->result = array_values($this->result);
$this->_post_execute();
if ($cache) {
$cache->cache_set('results');
......
......@@ -65,7 +65,8 @@ function build(&$view) { }
* Values to set: $view->result, $view->total_rows, $view->execute_time,
* $view->pager['current_page'].
*
* $view->result should contain an array of objects.
* $view->result should contain an array of objects. The array must use a
* numeric index starting at 0.
*
* @param view $view
* The view which is executed.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment