From cd0c5db14141d8bc2e3bf1686e095f64c955d4d7 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Wed, 20 May 2009 07:30:02 +0000 Subject: [PATCH] API CHANGE Removed @deprecated SearchForm::showInSearchTurnOn: Please ensure that pages which should be searched have ShowInSearch field checked in the CMS git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@77394 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- search/SearchForm.php | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/search/SearchForm.php b/search/SearchForm.php index 34cde65b8..5c7d258e4 100755 --- a/search/SearchForm.php +++ b/search/SearchForm.php @@ -14,12 +14,6 @@ */ class SearchForm extends Form { - /** - * @var boolean $showInSearchTurnOn - * @deprecated 2.3 SiteTree->ShowInSearch should always be respected - */ - protected $showInSearchTurnOn; - /** * @var int $pageLength How many results are shown per page. * Relies on pagination being implemented in the search results template. @@ -38,11 +32,8 @@ class SearchForm extends Form { * @param FieldSet $fields Optional, defaults to a single field named "Search". Search logic needs to be customized * if fields are added to the form. * @param FieldSet $actions Optional, defaults to a single field named "Go". - * @param boolean $showInSearchTurnOn DEPRECATED 2.3 */ - function __construct($controller, $name, $fields = null, $actions = null, $showInSearchTurnOn = true) { - $this->showInSearchTurnOn = $showInSearchTurnOn; - + function __construct($controller, $name, $fields = null, $actions = null) { if(!$fields) { $fields = new FieldSet( new TextField('Search', _t('SearchForm.SEARCH', 'Search') @@ -183,7 +174,8 @@ class SearchForm extends Form { else $extraFilters['File'] = $extraFilters['SiteTree']; } - if($this->showInSearchTurnOn) $extraFilters['SiteTree'] .= " AND showInSearch <> 0"; + // Always ensure that only pages with ShowInSearch = 1 can be searched + $extraFilters['SiteTree'] .= " AND ShowInSearch <> 0"; $start = isset($_GET['start']) ? (int)$_GET['start'] : 0; $limit = $start . ", " . (int) $pageLength;