mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
BUGFIX: Fixed subsite query rewriting with trunk query syntax
This commit is contained in:
parent
afe75ea88e
commit
6037ec56e5
@ -55,7 +55,7 @@ class GroupSubsites extends DataObjectDecorator {
|
||||
if(Subsite::$disable_subsite_filter) return;
|
||||
|
||||
// If you're querying by ID, ignore the sub-site - this is a bit ugly...
|
||||
if(!$query->where || (strpos($query->where[0], ".`ID` = ") === false && strpos($query->where[0], ".ID = ") === false)) {
|
||||
if(!$query->where || (strpos($query->where[0], ".\"ID\" = ") === false && strpos($query->where[0], ".`ID` = ") === false && strpos($query->where[0], ".ID = ") === false)) {
|
||||
|
||||
if($context = DataObject::context_obj()) $subsiteID = (int)$context->SubsiteID;
|
||||
else $subsiteID = (int)Subsite::currentSubsiteID();
|
||||
|
@ -46,7 +46,7 @@ class SiteTreeSubsites extends DataObjectDecorator {
|
||||
if(Subsite::$disable_subsite_filter) return;
|
||||
|
||||
// If you're querying by ID, ignore the sub-site - this is a bit ugly...
|
||||
if(!$query->where || (strpos($query->where[0], ".`ID` = ") === false && strpos($query->where[0], ".ID = ") === false && strpos($query->where[0], "ID = ") !== 0)) {
|
||||
if(!$query->where || (strpos($query->where[0], ".\"ID\" = ") === false && strpos($query->where[0], ".`ID` = ") === false && strpos($query->where[0], ".ID = ") === false && strpos($query->where[0], "ID = ") !== 0)) {
|
||||
|
||||
if($context = DataObject::context_obj()) $subsiteID = (int)$context->SubsiteID;
|
||||
else $subsiteID = (int)Subsite::currentSubsiteID();
|
||||
|
@ -364,7 +364,6 @@ JS;
|
||||
"`MemberID` = {$member->ID}",
|
||||
'',
|
||||
"LEFT JOIN `Group` ON `Subsite`.`ID` = `SubsiteID`
|
||||
LEFT JOIN `Permission` ON `Group`.`ID` = `Permission`.`GroupID`
|
||||
LEFT JOIN `Group_Members` ON `Group`.`ID` = `Group_Members`.`GroupID`"
|
||||
);
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ Group:
|
||||
Permissions: =>Permission.accesscmsmain1
|
||||
subsite2_group:
|
||||
Title: subsite2_group
|
||||
Code: subsite1_group
|
||||
Code: subsite2_group
|
||||
Subsite: =>Subsite_Template.subsite2
|
||||
Permissions: =>Permission.accesscmsmain2
|
||||
Member:
|
||||
|
Loading…
Reference in New Issue
Block a user