[-] 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 = '')
|
||||
{
|
||||
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;
|
||||
|
||||
$match_url = (($this->ssl && Configuration::get('PS_SSL_ENABLED')) ? 'https://' : 'http://').$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
|
||||
|
||||
@@ -270,12 +270,13 @@ class AdminModulesPositionsControllerCore extends AdminController
|
||||
'href' => self::$currentIndex.'&addToHook'.($this->display_key ? '&show_modules='.$this->display_key : '').'&token='.$this->token,
|
||||
'desc' => $this->l('Transplant a module')
|
||||
);
|
||||
|
||||
|
||||
$live_edit_params = array(
|
||||
'live_edit' => true,
|
||||
'ad' => $admin_dir,
|
||||
'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(
|
||||
@@ -304,7 +305,7 @@ class AdminModulesPositionsControllerCore extends AdminController
|
||||
$lang = '';
|
||||
if (Configuration::get('PS_REWRITING_SETTINGS') && count(Language::getLanguages(true)) > 1)
|
||||
$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;
|
||||
}
|
||||
|
||||
@@ -53,6 +53,8 @@ class CategoryControllerCore extends FrontController
|
||||
|
||||
public function canonicalRedirection($canonicalURL = '')
|
||||
{
|
||||
if (Tools::getValue('live_edit'))
|
||||
return ;
|
||||
if (!Validate::isLoadedObject($this->category) || !$this->category->inShop() || !$this->category->isAssociatedToShop())
|
||||
{
|
||||
$this->redirect_after = '404';
|
||||
|
||||
@@ -33,6 +33,8 @@ class CmsControllerCore extends FrontController
|
||||
|
||||
public function canonicalRedirection($canonicalURL = '')
|
||||
{
|
||||
if (Tools::getValue('live_edit'))
|
||||
return ;
|
||||
if (Validate::isLoadedObject($this->cms) && ($canonicalURL = $this->context->link->getCMSLink($this->cms)))
|
||||
parent::canonicalRedirection($canonicalURL);
|
||||
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 = '')
|
||||
{
|
||||
if (Tools::getValue('live_edit'))
|
||||
return ;
|
||||
if (Validate::isLoadedObject($this->manufacturer))
|
||||
parent::canonicalRedirection($this->context->link->getManufacturerLink($this->manufacturer));
|
||||
}
|
||||
|
||||
@@ -69,6 +69,8 @@ class ProductControllerCore extends FrontController
|
||||
|
||||
public function canonicalRedirection($canonical_url = '')
|
||||
{
|
||||
if (Tools::getValue('live_edit'))
|
||||
return ;
|
||||
if (Validate::isLoadedObject($this->product))
|
||||
parent::canonicalRedirection($this->context->link->getProductLink($this->product));
|
||||
}
|
||||
|
||||
@@ -41,6 +41,8 @@ class SupplierControllerCore extends FrontController
|
||||
|
||||
public function canonicalRedirection($canonicalURL = '')
|
||||
{
|
||||
if (Tools::getValue('live_edit'))
|
||||
return ;
|
||||
if (Validate::isLoadedObject($this->supplier))
|
||||
parent::canonicalRedirection($this->context->link->getSupplierLink($this->supplier));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user