summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2012-04-28 23:11:57 -0700
committerwebchick <webchick@24967.no-reply.drupal.org>2012-04-28 23:11:57 -0700
commita7d43f3460a97ad3c9b1cb23f7d374a4994837a3 (patch)
tree516f8047365df281c88843d93895291cb363710a /includes
parent060eb35f0ae4cde353a0048a6da0818b2fd5fb35 (diff)
downloadbrdo-a7d43f3460a97ad3c9b1cb23f7d374a4994837a3.tar.gz
brdo-a7d43f3460a97ad3c9b1cb23f7d374a4994837a3.tar.bz2
Issue #1490150 by xjm, duellj, tim.plunkett: Fixed EntityFieldQuery::pager(0) generates PHP error 'divide by zero'.
Diffstat (limited to 'includes')
-rw-r--r--includes/entity.inc7
1 files changed, 3 insertions, 4 deletions
diff --git a/includes/entity.inc b/includes/entity.inc
index 5f721f1d9..ae7807794 100644
--- a/includes/entity.inc
+++ b/includes/entity.inc
@@ -1263,12 +1263,11 @@ class EntityFieldQuery {
/**
* Get the total number of results and initialize a pager for the query.
*
- * This query can be detected by checking for ($this->pager && $this->count),
- * which allows a driver to return 0 from the count query and disable
- * the pager.
+ * The pager can be disabled by either setting the pager limit to 0, or by
+ * setting this query to be a count query.
*/
function initializePager() {
- if ($this->pager && !$this->count) {
+ if ($this->pager && !empty($this->pager['limit']) && !$this->count) {
$page = pager_find_page($this->pager['element']);
$count_query = clone $this;
$this->pager['total'] = $count_query->count()->execute();