summaryrefslogtreecommitdiff
path: root/includes/pager.inc
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-08-26 04:58:23 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-08-26 04:58:23 +0000
commitfd164e9d0239ee95f6b6c9789ed6adfe2a5b0457 (patch)
tree1f302160569f9219c40de4342462b4a36b9e6e91 /includes/pager.inc
parente8328996581ecc1e54290a723ab97833da136d08 (diff)
downloadbrdo-fd164e9d0239ee95f6b6c9789ed6adfe2a5b0457.tar.gz
brdo-fd164e9d0239ee95f6b6c9789ed6adfe2a5b0457.tar.bz2
#496516 by Crell and Berdir: Moved query_alter() into a preExecute() method, so that modules can know the final query/arguments before they are run.
Diffstat (limited to 'includes/pager.inc')
-rw-r--r--includes/pager.inc15
1 files changed, 15 insertions, 0 deletions
diff --git a/includes/pager.inc b/includes/pager.inc
index 26b9eb833..e9e6ea257 100644
--- a/includes/pager.inc
+++ b/includes/pager.inc
@@ -43,6 +43,14 @@ class PagerDefault extends SelectQueryExtender {
*/
protected $customCountQuery = FALSE;
+ public function __construct(SelectQueryInterface $query, DatabaseConnection $connection) {
+ parent::__construct($query, $connection);
+
+ // Add pager tag. Do this here to ensure that it is always added before
+ // preExecute() is called.
+ $this->addTag('pager');
+ }
+
/**
* Override the execute method.
*
@@ -52,6 +60,13 @@ class PagerDefault extends SelectQueryExtender {
public function execute() {
global $pager_page_array, $pager_total, $pager_total_items, $pager_limits;
+ // Add convenience tag to mark that this is an extended query. We have to
+ // do this in the constructor to ensure that it is set before preExecute()
+ // gets called.
+ if (!$this->preExecute($this)) {
+ return NULL;
+ }
+
// A NULL limit is the "kill switch" for pager queries.
if (empty($this->limit)) {
return;