// Fixed warehouses/carriers associations - #PI-134

This commit is contained in:
bMancone
2012-04-17 12:21:22 +00:00
parent 71c8288fee
commit 422da7c69a
+19 -12
View File
@@ -538,18 +538,6 @@ class AdminWarehousesControllerCore extends AdminController
}
}
// if updating
if ($obj->id > 0)
{
// handles shops associations
if (Tools::isSubmit('ids_shops'))
$obj->setShops(Tools::getValue('ids_shops'));
// handles carriers associations
if (Tools::isSubmit('ids_carriers'))
$obj->setCarriers(Tools::getValue('ids_carriers'));
}
// hack for enable the possibility to update a warehouse without recreate new id
$this->deleted = false;
@@ -588,6 +576,25 @@ class AdminWarehousesControllerCore extends AdminController
}
}
/**
* @see AdminController::processUpdate();
*/
public function processUpdate()
{
if (!($obj = $this->loadObject(true)))
return;
// handles shops associations
if (Tools::isSubmit('ids_shops'))
$obj->setShops(Tools::getValue('ids_shops'));
// handles carriers associations
$obj->setCarriers(Tools::getValue('ids_carriers'), array());
return parent::processUpdate();
}
/**
* @see AdminController::initProcess()
*/