Skip to content

Commit

Permalink
Merge pull request #53 from stephenmcm/feature-reindexbug
Browse files Browse the repository at this point in the history
Fix Reindex job failing DataObject::get() on classes that don't implement $db
  • Loading branch information
nyeholt committed Aug 16, 2016
2 parents 0e42a57 + 9a7ac48 commit 5a2b060
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion code/tasks/SolrReindexJob.php
Expand Up @@ -40,7 +40,8 @@ public function process() {
Subsite::disable_subsite_filter();
}

$pages = DataObject::get($this->reindexType, '"' . $this->reindexType.'"."ID" > ' . $this->lastIndexedID, 'ID ASC', '', '0, ' . self::$at_a_time);
$class = $this->reindexType;
$pages = $class::get()->filter('ID:GreaterThan', $this->lastIndexedID)->sort('ID ASC')->limit('0, ' . self::$at_a_time);

if (ClassInfo::exists('Subsite')) {
Subsite::$disable_subsite_filter = false;
Expand Down

0 comments on commit 5a2b060

Please sign in to comment.