ENHANCEMENT Optionally filtering by new File.ShowInSearch flag in SQLite3Database->searcnEngine()

This commit is contained in:
Ingo Schommer 2011-09-15 16:03:03 +02:00
parent 2e1dc517e6
commit 1b36c75f0a

View File

@ -871,7 +871,13 @@ class SQLite3Database extends SS_Database {
}
// Always ensure that only pages with ShowInSearch = 1 can be searched
$extraFilters['SiteTree'] .= " AND ShowInSearch <> 0";
$extraFilters['SiteTree'] .= ' AND ShowInSearch <> 0';
// File.ShowInSearch was added later, keep the database driver backwards compatible
// by checking for its existence first
$fields = $this->fieldList('File');
if(array_key_exists('ShowInSearch', $fields)) {
$extraFilters['File'] .= " AND ShowInSearch <> 0";
}
$limit = $start . ", " . (int) $pageLength;