Exclude subsites without titles from site lists

This commit is contained in:
Sam Minnee 2008-02-26 03:14:27 +00:00
parent 72ea4dfa43
commit ea940fcd0d
2 changed files with 3 additions and 1 deletions

View File

@ -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`");

View File

@ -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");