silverstripe /
cwp-search
| 1 | <?php |
||
| 2 | |||
| 3 | namespace CWP\Search; |
||
| 4 | |||
| 5 | use PageController; |
||
|
0 ignored issues
–
show
|
|||
| 6 | |||
| 7 | /** |
||
| 8 | * Description of SearchPageController |
||
| 9 | * |
||
| 10 | * @author dmooyman |
||
| 11 | */ |
||
| 12 | class CwpSearchPageController extends PageController |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * Create the dummy search record for this page |
||
| 16 | * |
||
| 17 | * @return CwpSearchPage |
||
| 18 | */ |
||
| 19 | protected function generateSearchRecord() |
||
| 20 | { |
||
| 21 | $searchPage = CwpSearchPage::create(); |
||
| 22 | $searchPage->URLSegment = 'search'; |
||
| 23 | $searchPage->Title = _t('SilverStripe\\CMS\\Search\\SearchForm.SearchResults', 'Search Results'); |
||
| 24 | $searchPage->ID = -1; |
||
| 25 | return $searchPage; |
||
| 26 | } |
||
| 27 | |||
| 28 | public function __construct($dataRecord = null) |
||
| 29 | { |
||
| 30 | if (!$dataRecord) { |
||
| 31 | $dataRecord = $this->generateSearchRecord(); |
||
| 32 | } |
||
| 33 | parent::__construct($dataRecord); |
||
| 34 | } |
||
| 35 | |||
| 36 | public function index() |
||
| 37 | { |
||
| 38 | return $this->redirect($this->Link('SearchForm')); |
||
| 39 | } |
||
| 40 | } |
||
| 41 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths