mirror of
https://github.com/silverstripe/silverstripe-mssql
synced 2024-10-22 08:05:53 +02:00
ENHANCEMENT Optionally filtering by new File.ShowInSearch flag in MSSQLDatabase->searcnEngine()
This commit is contained in:
parent
00b81bbdd4
commit
4b933d7e73
@ -1327,6 +1327,13 @@ class MSSQLDatabase extends SS_Database {
|
||||
$where = null;
|
||||
if(strpos($tableName, 'SiteTree') === 0) {
|
||||
$where = array("\"$tableName\".\"ShowInSearch\"!=0");
|
||||
} elseif(strpos($tableName, 'File') === 0) {
|
||||
// File.ShowInSearch was added later, keep the database driver backwards compatible
|
||||
// by checking for its existence first
|
||||
$fields = $this->fieldList($tableName);
|
||||
if(array_key_exists('ShowInSearch', $fields)) {
|
||||
$where = array("\"$tableName\".\"ShowInSearch\"!=0");
|
||||
}
|
||||
}
|
||||
|
||||
$queries[$tableName] = singleton($tableName)->extendedSQL($where);
|
||||
|
Loading…
Reference in New Issue
Block a user