From 12758e7cec89df12571963823d26788ad1bb66a7 Mon Sep 17 00:00:00 2001 From: Andrew O'Neil Date: Thu, 2 Feb 2017 13:53:21 +1100 Subject: [PATCH] Fix errors when fulltext search is disabled. Prevent attempted creation of non-fulltext index when fulltext search is not available. --- code/MSSQLDatabase.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/MSSQLDatabase.php b/code/MSSQLDatabase.php index 0eee06e..c7956c4 100644 --- a/code/MSSQLDatabase.php +++ b/code/MSSQLDatabase.php @@ -943,7 +943,11 @@ class MSSQLDatabase extends SS_Database { $drop = "IF EXISTS (SELECT name FROM sys.indexes WHERE name = '$index') DROP INDEX $index ON \"" . $tableName . "\";"; // create a type-specific index - if($indexSpec['type'] == 'fulltext' && $this->fullTextEnabled()) { + if($indexSpec['type'] == 'fulltext') { + if(!$this->fullTextEnabled()) { + return; + } + // enable fulltext on this table $this->createFullTextCatalog(); $primary_key = $this->getPrimaryKey($tableName);