/** * Returns the total number of elements matched by this criteria. * Fixes live preview mode which broke in Craft 2.6.2793 due to this method. If live preview mode is detected, it * uses the old method which worked in live preview mode. * * @return int */ public function count() { if (craft()->neo->isPreviewMode()) { return count($this->find()); } return parent::count(); }