AbstractController::getExistingObject return object with hte needed
locale inside
This commit is contained in:
@@ -156,9 +156,14 @@ class CategoryController extends AbstractSeoCrudController
|
|||||||
|
|
||||||
protected function getExistingObject()
|
protected function getExistingObject()
|
||||||
{
|
{
|
||||||
return CategoryQuery::create()
|
$category = CategoryQuery::create()
|
||||||
->joinWithI18n($this->getCurrentEditionLocale())
|
->findOneById($this->getRequest()->get('category_id', 0));
|
||||||
->findOneById($this->getRequest()->get('category_id', 0));
|
|
||||||
|
if (null !== $category) {
|
||||||
|
$category->setLocale($this->getCurrentEditionLocale());
|
||||||
|
}
|
||||||
|
|
||||||
|
return $category;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getObjectLabel($object)
|
protected function getObjectLabel($object)
|
||||||
|
|||||||
@@ -236,9 +236,13 @@ class ContentController extends AbstractSeoCrudController
|
|||||||
*/
|
*/
|
||||||
protected function getExistingObject()
|
protected function getExistingObject()
|
||||||
{
|
{
|
||||||
return ContentQuery::create()
|
$content = ContentQuery::create()
|
||||||
->joinWithI18n($this->getCurrentEditionLocale())
|
|
||||||
->findOneById($this->getRequest()->get('content_id', 0));
|
->findOneById($this->getRequest()->get('content_id', 0));
|
||||||
|
|
||||||
|
if (null !== $content) {
|
||||||
|
$content->setLocale($this->getCurrentEditionLocale());
|
||||||
|
}
|
||||||
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -199,9 +199,13 @@ class FolderController extends AbstractSeoCrudController
|
|||||||
*/
|
*/
|
||||||
protected function getExistingObject()
|
protected function getExistingObject()
|
||||||
{
|
{
|
||||||
return FolderQuery::create()
|
$folder = FolderQuery::create()
|
||||||
->joinWithI18n($this->getCurrentEditionLocale())
|
|
||||||
->findOneById($this->getRequest()->get('folder_id', 0));
|
->findOneById($this->getRequest()->get('folder_id', 0));
|
||||||
|
|
||||||
|
if (null !== $folder) {
|
||||||
|
$folder->setLocale($this->getCurrentEditionLocale());
|
||||||
|
}
|
||||||
|
return $folder;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -343,9 +343,14 @@ class ProductController extends AbstractSeoCrudController
|
|||||||
|
|
||||||
protected function getExistingObject()
|
protected function getExistingObject()
|
||||||
{
|
{
|
||||||
return ProductQuery::create()
|
$product = ProductQuery::create()
|
||||||
->joinWithI18n($this->getCurrentEditionLocale())
|
->findOneById($this->getRequest()->get('product_id', 0));
|
||||||
->findOneById($this->getRequest()->get('product_id', 0));
|
|
||||||
|
if (null !== $product) {
|
||||||
|
$product->setLocale($this->getCurrentEditionLocale());
|
||||||
|
}
|
||||||
|
|
||||||
|
return $product;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getObjectLabel($object)
|
protected function getObjectLabel($object)
|
||||||
|
|||||||
Reference in New Issue
Block a user