Merge branch 'master' of github.com:thelia/thelia
This commit is contained in:
@@ -133,7 +133,7 @@ class CategoryController extends AbstractCrudController
|
||||
'description' => $object->getDescription(),
|
||||
'postscriptum' => $object->getPostscriptum(),
|
||||
'visible' => $object->getVisible(),
|
||||
'url' => $object->getRewritenUrl($this->getCurrentEditionLocale()),
|
||||
'url' => $object->getRewrittenUrl($this->getCurrentEditionLocale()),
|
||||
'parent' => $object->getParent()
|
||||
);
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ class ProductController extends AbstractCrudController
|
||||
'description' => $object->getDescription(),
|
||||
'postscriptum' => $object->getPostscriptum(),
|
||||
'visible' => $object->getVisible(),
|
||||
'url' => $object->getRewritenUrl($this->getCurrentEditionLocale()),
|
||||
'url' => $object->getRewrittenUrl($this->getCurrentEditionLocale()),
|
||||
'parent' => $object->getParent()
|
||||
);
|
||||
|
||||
|
||||
@@ -79,7 +79,6 @@ class Category extends BaseCategory
|
||||
*/
|
||||
public function postInsert(ConnectionInterface $con = null)
|
||||
{
|
||||
//$this->generateRewrittenUrl($this->getLocale());
|
||||
$this->dispatchEvent(TheliaEvents::AFTER_CREATECATEGORY, new CategoryEvent($this));
|
||||
}
|
||||
|
||||
|
||||
@@ -39,9 +39,4 @@ class Content extends BaseContent
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function postInsert(ConnectionInterface $con = null)
|
||||
{
|
||||
//$this->generateRewrittenUrl($this->getLocale());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,9 +70,4 @@ class Folder extends BaseFolder
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function postInsert(ConnectionInterface $con = null)
|
||||
{
|
||||
//$this->generateRewrittenUrl($this->getLocale());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,14 @@
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Thelia\Model\Base\FolderI18n as BaseFolderI18n;
|
||||
|
||||
class FolderI18n extends BaseFolderI18n {
|
||||
|
||||
public function postInsert(ConnectionInterface $con = null)
|
||||
{
|
||||
$folder = $this->getFolder();
|
||||
$folder->generateRewrittenUrl($this->getLocale());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,7 +119,6 @@ class Product extends BaseProduct
|
||||
*/
|
||||
public function postInsert(ConnectionInterface $con = null)
|
||||
{
|
||||
//$this->generateRewrittenUrl($this->getLocale());
|
||||
$this->dispatchEvent(TheliaEvents::AFTER_CREATEPRODUCT, new ProductEvent($this));
|
||||
}
|
||||
|
||||
|
||||
@@ -2,8 +2,14 @@
|
||||
|
||||
namespace Thelia\Model;
|
||||
|
||||
use Propel\Runtime\Connection\ConnectionInterface;
|
||||
use Thelia\Model\Base\ProductI18n as BaseProductI18n;
|
||||
|
||||
class ProductI18n extends BaseProductI18n {
|
||||
|
||||
public function postInsert(ConnectionInterface $con = null)
|
||||
{
|
||||
$product = $this->getProduct();
|
||||
$product->generateRewrittenUrl($this->getLocale());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,6 +76,7 @@ class ProductRewriteTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Thelia\Model\Tools\UrlRewritingTrait::generateRewrittenUrl
|
||||
* @expectedException \RuntimeException
|
||||
* @expectedExceptionMessage Object product must be saved before generating url
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user