mirror of
https://github.com/silverstripe/silverstripe-externallinks.git
synced 2024-10-22 17:05:44 +02:00
BUG: Adding support for PostgreSQL
This commit is contained in:
parent
cbbd0a6a4d
commit
01b89a1a85
@ -9,7 +9,7 @@ class CheckExternalLinksJob extends AbstractQueuedJob {
|
||||
public static $regenerate_time = 43200;
|
||||
|
||||
public function __construct() {
|
||||
$this->pagesToProcess = DB::query('SELECT ID FROM "SiteTree_Live" WHERE "ShowInSearch"=1')->column();
|
||||
$this->pagesToProcess = DB::query('SELECT "ID" FROM "SiteTree_Live" WHERE "ShowInSearch"=1')->column();
|
||||
$this->currentStep = 0;
|
||||
$this->totalSteps = count($this->pagesToProcess);
|
||||
}
|
||||
@ -49,7 +49,7 @@ class CheckExternalLinksJob extends AbstractQueuedJob {
|
||||
$restart = $this->currentStep == 0;
|
||||
|
||||
if ($restart) {
|
||||
$this->pagesToProcess = DB::query('SELECT ID FROM SiteTree_Live WHERE ShowInSearch=1')->column();
|
||||
$this->pagesToProcess = DB::query('SELECT "ID" FROM SiteTree_Live WHERE ShowInSearch=1')->column();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -51,8 +51,8 @@ class CheckExternalLinks extends BuildTask {
|
||||
|
||||
// use raw sql query to set broken link as calling the dataobject write
|
||||
// method will reset the links if no broken internal links are found
|
||||
$query = 'UPDATE SiteTree SET HasBrokenLink = 1 ';
|
||||
$query .= 'WHERE ID = ' . (int)$page->ID;
|
||||
$query = "UPDATE \"SiteTree\" SET \"HasBrokenLink\" = 1 ";
|
||||
$query .= "WHERE \"ID\" = " . (int)$page->ID;
|
||||
$result = DB::query($query);
|
||||
if (!$result) {
|
||||
// error updating hasBrokenLink
|
||||
|
Loading…
Reference in New Issue
Block a user