BUGFIX allow Subsite Virtual Pages to share a URL Segment (from r82346)

This commit is contained in:
Tom Rix 2010-03-01 02:56:01 +00:00
parent 4801838dd0
commit 40ff605fbf
2 changed files with 1 additions and 14 deletions

View File

@ -59,8 +59,7 @@ class SiteTreeSubsites extends DataObjectDecorator {
else $q='`';
// If you're querying by ID, ignore the sub-site - this is a bit ugly...
if(!$query->where || (strpos($query->where[0], ".{$q}ID{$q} = ") === false && strpos($query->where[0], ".{$q}ID{$q} = ") === false && strpos($query->where[0], ".{$q}ID{$q} = ") === false && strpos($query->where[0], "{$q}ID{$q} = ") !== 0)) {
if (!$query->where || (!preg_match('/\.(\'|"|`|)ID(\'|"|`|)( ?)=/', $query->where[0]))) {
$context = DataObject::context_obj();
if($context && is_numeric($context->SubsiteID)) $subsiteID = (int) $context->SubsiteID;
else $subsiteID = (int) Subsite::currentSubsiteID();

View File

@ -65,18 +65,6 @@ class SubsitesVirtualPage extends VirtualPage {
return $fields;
}
function onBeforeWrite() {
Subsite::$disable_subsite_filter = true;
parent::onBeforeWrite();
}
function onAfterWrite() {
Subsite::$disable_subsite_filter = false;
parent::onAfterWrite();
}
}
class SubsitesVirtualPage_Controller extends VirtualPage_Controller {