mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
Improved subsite-admin search to support unit testing
This commit is contained in:
parent
5e9b67216f
commit
b64b14554c
@ -21,15 +21,14 @@ class SubsiteAdmin extends GenericDataAdmin {
|
||||
return $this->getLink();
|
||||
}
|
||||
|
||||
function Results() {
|
||||
function Results($data, $form) {
|
||||
$where = '';
|
||||
|
||||
if(isset($_REQUEST['action_getResults']) && $_REQUEST['action_getResults']) {
|
||||
$SQL_name = Convert::raw2sql($_REQUEST['Name']);
|
||||
if(isset($data['Name']) && $data['Name']) {
|
||||
$SQL_name = Convert::raw2sql($data['Name']);
|
||||
$where = "`Title` LIKE '%$SQL_name%'";
|
||||
}
|
||||
|
||||
$intranets = DataObject::get('Intranet', $where);
|
||||
$intranets = DataObject::get('Subsite', $where);
|
||||
if(!$intranets)
|
||||
return null;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user