Skip to content

Commit

Permalink
Show in search remove duplicated field for SiteTree main tab
Browse files Browse the repository at this point in the history
  • Loading branch information
amolswnz committed May 1, 2024
1 parent 71187de commit c5a5489
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Extensions/SearchServiceExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace SilverStripe\SearchService\Extensions;

use Exception;
use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\Core\Config\Configurable;
use SilverStripe\Core\Injector\Injectable;
use SilverStripe\Forms\CheckboxField;
Expand Down Expand Up @@ -74,8 +75,7 @@ public function updateCMSFields(FieldList $fields): void
_t(self::class . '.LastIndexed', 'Last indexed in search')
);

if ($fields->hasTabSet()) {
$fields->addFieldToTab('Root.Main', $showInSearchField);
if ($this->owner instanceof SiteTree) {
$fields->addFieldToTab('Root.Main', $searchIndexedField);
} else {
$fields->push($showInSearchField);
Expand Down

0 comments on commit c5a5489

Please sign in to comment.