//fixed small bug when added new Shop URL
This commit is contained in:
@@ -124,10 +124,11 @@ class ShopUrlCore extends ObjectModel
|
||||
public function canAddThisUrl($domain, $domain_ssl, $physical_uri, $virtual_uri)
|
||||
{
|
||||
$physical_uri = trim($physical_uri, '/');
|
||||
|
||||
if ($physical_uri)
|
||||
$physical_uri = preg_replace('#/+#', '/', '/'.$physical_uri.'/');
|
||||
else
|
||||
$this->physical_uri = '/';
|
||||
$physical_uri = '/';
|
||||
|
||||
$virtual_uri = trim($virtual_uri, '/');
|
||||
if ($virtual_uri)
|
||||
|
||||
@@ -360,6 +360,10 @@ class AdminShopUrlControllerCore extends AdminController
|
||||
public function processAdd()
|
||||
{
|
||||
$object = $this->loadObject(true);
|
||||
|
||||
if ($object->canAddThisUrl(Tools::getValue('domain'), Tools::getValue('domain_ssl'), Tools::getValue('physical_uri'), Tools::getValue('virtual_uri')))
|
||||
$this->errors[] = Tools::displayError('A shop URL that use this domain and uri already exists');
|
||||
|
||||
if ($object->id && Tools::getValue('main'))
|
||||
$object->setMain();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user