BUGFIX Using uncached DataObject::get_one() calls in ModelAsController to avoid stale data with subsequent Director::test() calls which alter the page relations inbetween

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65456 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2008-11-08 00:02:35 +00:00
parent 137b76e271
commit 192078d3d2

View File

@ -34,9 +34,9 @@ class ModelAsController extends Controller implements NestedController {
if($this->urlParams['URLSegment']) {
$SQL_URLSegment = Convert::raw2sql($this->urlParams['URLSegment']);
if (Translatable::is_enabled()) {
$child = Translatable::get_one("SiteTree", "URLSegment = '$SQL_URLSegment'");
$child = Translatable::get_one("SiteTree", "URLSegment = '$SQL_URLSegment'", false);
} else {
$child = DataObject::get_one("SiteTree", "URLSegment = '$SQL_URLSegment'");
$child = DataObject::get_one("SiteTree", "URLSegment = '$SQL_URLSegment'", false);
}
if(!$child) {
$child = $this->get404Page();