Merge branch 'master' into frontend
This commit is contained in:
@@ -71,7 +71,9 @@ class RewritingRetriever
|
||||
$this->rewrittenUrl = null;
|
||||
$this->url = URL::getInstance()->viewUrl($view, $allParametersWithoutView);
|
||||
if($this->search !== null) {
|
||||
$this->rewrittenUrl = $this->search->getUrl();
|
||||
$this->rewrittenUrl = URL::getInstance()->absoluteUrl(
|
||||
$this->search->getUrl()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ namespace Thelia\Tests\Action;
|
||||
|
||||
use Propel\Runtime\ActiveQuery\Criteria;
|
||||
use Thelia\Exception\UrlRewritingException;
|
||||
use Thelia\Model\Base\ProductQuery;
|
||||
use Thelia\Model\Base\RewritingUrlQuery;
|
||||
use Thelia\Model\ConfigQuery;
|
||||
use Thelia\Rewriting\RewritingResolver;
|
||||
@@ -81,6 +82,17 @@ trait RewrittenUrlTestTrait
|
||||
$this->assertEquals($oldUrlEntry->getRedirected(), $newUrlEntry->getId());
|
||||
|
||||
/* we can reassign old Url to another object */
|
||||
//@todo
|
||||
$aRandomProduct = ProductQuery::create()
|
||||
->filterById($object->getId(), Criteria::NOT_EQUAL)
|
||||
->findOne();
|
||||
|
||||
$failReassign = true;
|
||||
try {
|
||||
$aRandomProduct->setRewrittenUrl($aRandomProduct->getLocale(), $currentUrl);
|
||||
$failReassign = false;
|
||||
} catch(\Exception $e) {
|
||||
}
|
||||
|
||||
$this->assertFalse($failReassign);
|
||||
}
|
||||
}
|
||||
@@ -101,7 +101,7 @@ class RewritingRetrieverTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$retriever->loadViewUrl('view', 'fr_FR', 1);
|
||||
|
||||
$this->assertEquals('foo.html', $retriever->rewrittenUrl);
|
||||
$this->assertEquals(URL::getInstance()->absoluteUrl('foo.html'), $retriever->rewrittenUrl);
|
||||
$this->assertEquals(URL::getInstance()->viewUrl('view', array('locale' => 'fr_FR', 'view_id' => 1)), $retriever->url);
|
||||
}
|
||||
|
||||
|
||||
@@ -199,7 +199,7 @@ class URL
|
||||
public function retrieve($view, $viewId, $viewLocale)
|
||||
{
|
||||
if (ConfigQuery::isRewritingEnable()) {
|
||||
URL::getInstance()->absoluteUrl($this->retriever->loadViewUrl($view, $viewLocale, $viewId));
|
||||
$this->retriever->loadViewUrl($view, $viewLocale, $viewId);
|
||||
} else {
|
||||
$allParametersWithoutView = array();
|
||||
$allParametersWithoutView['locale'] = $viewLocale;
|
||||
|
||||
@@ -622,7 +622,7 @@ return array(
|
||||
'Product EAN Code' => 'Code EAN du produit',
|
||||
'Product Features' => 'Caractéristiques du produit',
|
||||
'Product accessories' => 'Accessoires du produit',
|
||||
'Product attributes' => 'Attributs produit',
|
||||
'Product attributes' => 'Déclinaisons produit',
|
||||
'Product catalog configuration' => 'Configuration du catalogue produit',
|
||||
'Product created on %date_create. Last modification: %date_change' => 'Produit créé le %date_create. Dernière modification le %date_change',
|
||||
'Product features' => 'Caractéristiques produit',
|
||||
|
||||
Reference in New Issue
Block a user