BUG Check for extensions on record in CMS (fixes #41)

This commit is contained in:
Ingo Schommer 2012-08-13 10:06:12 +02:00
parent d837220b01
commit 4f433155f1

View File

@ -30,7 +30,7 @@ class TranslatableCMSMainExtension extends Extension {
// if a locale is set, it needs to match to the current record // if a locale is set, it needs to match to the current record
$requestLocale = $req->requestVar("Locale") ? $req->requestVar("Locale") : $req->requestVar("locale"); $requestLocale = $req->requestVar("Locale") ? $req->requestVar("Locale") : $req->requestVar("locale");
$page = $this->owner->currentPage(); $page = $this->owner->currentPage();
if($requestLocale && $page && $page->Locale != $requestLocale) { if($requestLocale && $page && $page->hasExtension('Translatable') && $page->Locale != $requestLocale) {
$transPage = $page->getTranslation($requestLocale); $transPage = $page->getTranslation($requestLocale);
if($transPage) { if($transPage) {
Translatable::set_current_locale($transPage->Locale); Translatable::set_current_locale($transPage->Locale);