[-] BO : fixed bug #PSCFV-9782 - live edit bug with multistore
This commit is contained in:
@@ -594,7 +594,7 @@ class FrontControllerCore extends Controller
|
|||||||
|
|
||||||
protected function canonicalRedirection($canonical_url = '')
|
protected function canonicalRedirection($canonical_url = '')
|
||||||
{
|
{
|
||||||
if (!$canonical_url || !Configuration::get('PS_CANONICAL_REDIRECT') || strtoupper($_SERVER['REQUEST_METHOD']) != 'GET')
|
if (!$canonical_url || !Configuration::get('PS_CANONICAL_REDIRECT') || strtoupper($_SERVER['REQUEST_METHOD']) != 'GET' || Tools::getValue('live_edit'))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$match_url = (($this->ssl && Configuration::get('PS_SSL_ENABLED')) ? 'https://' : 'http://').$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
|
$match_url = (($this->ssl && Configuration::get('PS_SSL_ENABLED')) ? 'https://' : 'http://').$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
|
||||||
|
|||||||
@@ -275,7 +275,8 @@ class AdminModulesPositionsControllerCore extends AdminController
|
|||||||
'live_edit' => true,
|
'live_edit' => true,
|
||||||
'ad' => $admin_dir,
|
'ad' => $admin_dir,
|
||||||
'liveToken' => $this->token,
|
'liveToken' => $this->token,
|
||||||
'id_employee' => (int)$this->context->employee->id
|
'id_employee' => (int)$this->context->employee->id,
|
||||||
|
'id_shop' => (int)$this->context->shop->id
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->context->smarty->assign(array(
|
$this->context->smarty->assign(array(
|
||||||
@@ -304,7 +305,7 @@ class AdminModulesPositionsControllerCore extends AdminController
|
|||||||
$lang = '';
|
$lang = '';
|
||||||
if (Configuration::get('PS_REWRITING_SETTINGS') && count(Language::getLanguages(true)) > 1)
|
if (Configuration::get('PS_REWRITING_SETTINGS') && count(Language::getLanguages(true)) > 1)
|
||||||
$lang = Language::getIsoById($this->context->employee->id_lang).'/';
|
$lang = Language::getIsoById($this->context->employee->id_lang).'/';
|
||||||
$url = $this->context->shop->getBaseURL().$lang.Dispatcher::getInstance()->createUrl('index', (int)$this->context->language->id, $live_edit_params);
|
$url = 'http://'.Tools::getHttpHost().'/'.$lang.Dispatcher::getInstance()->createUrl('index', (int)$this->context->language->id, $live_edit_params);
|
||||||
|
|
||||||
return $url;
|
return $url;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,6 +53,8 @@ class CategoryControllerCore extends FrontController
|
|||||||
|
|
||||||
public function canonicalRedirection($canonicalURL = '')
|
public function canonicalRedirection($canonicalURL = '')
|
||||||
{
|
{
|
||||||
|
if (Tools::getValue('live_edit'))
|
||||||
|
return ;
|
||||||
if (!Validate::isLoadedObject($this->category) || !$this->category->inShop() || !$this->category->isAssociatedToShop())
|
if (!Validate::isLoadedObject($this->category) || !$this->category->inShop() || !$this->category->isAssociatedToShop())
|
||||||
{
|
{
|
||||||
$this->redirect_after = '404';
|
$this->redirect_after = '404';
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ class CmsControllerCore extends FrontController
|
|||||||
|
|
||||||
public function canonicalRedirection($canonicalURL = '')
|
public function canonicalRedirection($canonicalURL = '')
|
||||||
{
|
{
|
||||||
|
if (Tools::getValue('live_edit'))
|
||||||
|
return ;
|
||||||
if (Validate::isLoadedObject($this->cms) && ($canonicalURL = $this->context->link->getCMSLink($this->cms)))
|
if (Validate::isLoadedObject($this->cms) && ($canonicalURL = $this->context->link->getCMSLink($this->cms)))
|
||||||
parent::canonicalRedirection($canonicalURL);
|
parent::canonicalRedirection($canonicalURL);
|
||||||
else if (Validate::isLoadedObject($this->cms_category) && ($canonicalURL = $this->context->link->getCMSCategoryLink($this->cms_category)))
|
else if (Validate::isLoadedObject($this->cms_category) && ($canonicalURL = $this->context->link->getCMSCategoryLink($this->cms_category)))
|
||||||
|
|||||||
@@ -40,6 +40,8 @@ class ManufacturerControllerCore extends FrontController
|
|||||||
|
|
||||||
public function canonicalRedirection($canonicalURL = '')
|
public function canonicalRedirection($canonicalURL = '')
|
||||||
{
|
{
|
||||||
|
if (Tools::getValue('live_edit'))
|
||||||
|
return ;
|
||||||
if (Validate::isLoadedObject($this->manufacturer))
|
if (Validate::isLoadedObject($this->manufacturer))
|
||||||
parent::canonicalRedirection($this->context->link->getManufacturerLink($this->manufacturer));
|
parent::canonicalRedirection($this->context->link->getManufacturerLink($this->manufacturer));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,6 +69,8 @@ class ProductControllerCore extends FrontController
|
|||||||
|
|
||||||
public function canonicalRedirection($canonical_url = '')
|
public function canonicalRedirection($canonical_url = '')
|
||||||
{
|
{
|
||||||
|
if (Tools::getValue('live_edit'))
|
||||||
|
return ;
|
||||||
if (Validate::isLoadedObject($this->product))
|
if (Validate::isLoadedObject($this->product))
|
||||||
parent::canonicalRedirection($this->context->link->getProductLink($this->product));
|
parent::canonicalRedirection($this->context->link->getProductLink($this->product));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ class SupplierControllerCore extends FrontController
|
|||||||
|
|
||||||
public function canonicalRedirection($canonicalURL = '')
|
public function canonicalRedirection($canonicalURL = '')
|
||||||
{
|
{
|
||||||
|
if (Tools::getValue('live_edit'))
|
||||||
|
return ;
|
||||||
if (Validate::isLoadedObject($this->supplier))
|
if (Validate::isLoadedObject($this->supplier))
|
||||||
parent::canonicalRedirection($this->context->link->getSupplierLink($this->supplier));
|
parent::canonicalRedirection($this->context->link->getSupplierLink($this->supplier));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user