mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
Exclude subsites without titles from site lists
This commit is contained in:
parent
72ea4dfa43
commit
ea940fcd0d
@ -300,7 +300,7 @@ SQL;
|
||||
if(!$member) return new DataObjectSet();
|
||||
|
||||
$subsites = DataObject::get('Subsite',
|
||||
"`Group_Members`.`MemberID` = $member->ID AND `Permission`.`Code` IN ($SQL_codes, 'ADMIN') AND `Subsite`.Title != ''", '',
|
||||
"`Group_Members`.`MemberID` = $member->ID AND `Permission`.`Code` IN ($SQL_codes, 'ADMIN') AND Subdomain IS NOT NULL AND `Subsite`.Title != ''", '',
|
||||
"LEFT JOIN `Group` ON (`SubsiteID`=`Subsite`.`ID` OR `SubsiteID` = 0) LEFT JOIN `Group_Members` ON `Group_Members`.`GroupID`=`Group`.`ID`
|
||||
LEFT JOIN `Permission` ON `Group`.`ID`=`Permission`.`GroupID`");
|
||||
|
||||
|
@ -28,6 +28,8 @@ class SubsiteAdmin extends GenericDataAdmin {
|
||||
if(isset($data['Name']) && $data['Name']) {
|
||||
$SQL_name = Convert::raw2sql($data['Name']);
|
||||
$where = "`Title` LIKE '%$SQL_name%'";
|
||||
} else {
|
||||
$where = "`Title` != ''";
|
||||
}
|
||||
|
||||
$intranets = DataObject::get('Subsite', $where, "if(ClassName = 'Subsite_Template',0,1), Title");
|
||||
|
Loading…
Reference in New Issue
Block a user