From 2bbe5739b29597725f8db666841086401b988698 Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Sun, 15 Nov 2015 22:27:49 -0600 Subject: [PATCH] orm: No annotations for count queries --- include/class.orm.php | 1 + 1 file changed, 1 insertion(+) diff --git a/include/class.orm.php b/include/class.orm.php index 80c009cf0..80360f0e6 100644 --- a/include/class.orm.php +++ b/include/class.orm.php @@ -2795,6 +2795,7 @@ class MySqlCompiler extends SqlCompiler { $q->related = $q->anotations = false; $model = $q->model; $q->values = $model::getMeta('pk'); + $q->annotations = false; $exec = $q->getQuery(array('nosort' => true)); $exec->sql = 'SELECT COUNT(*) FROM ('.$exec->sql.') __'; $row = $exec->getRow(); -- GitLab