diff --git a/admin-dev/tabs/AdminCarriers.php b/admin-dev/tabs/AdminCarriers.php
index 1ff6e0c56..1da6e99d8 100644
--- a/admin-dev/tabs/AdminCarriers.php
+++ b/admin-dev/tabs/AdminCarriers.php
@@ -52,7 +52,7 @@ class AdminCarriers extends AdminTab
$this->optionTitle = $this->l('Carrier options');
$this->_fieldsOptions = array(
- 'PS_CARRIER_DEFAULT' => array('title' => $this->l('Default carrier:'), 'desc' => $this->l('The default carrier used in shop'), 'cast' => 'intval', 'type' => 'select', 'identifier' => 'id_carrier', 'list' => Carrier::getCarriers((int)(Configuration::get('PS_LANG_DEFAULT')), true , false,false, NULL, ALL_CARRIERS)),
+ 'PS_CARRIER_DEFAULT' => array('title' => $this->l('Default carrier:'), 'desc' => $this->l('The default carrier used in shop'), 'cast' => 'intval', 'type' => 'select', 'identifier' => 'id_carrier', 'list' => Carrier::getCarriers((int)(Configuration::get('PS_LANG_DEFAULT')), true , false,false, NULL, Carrier::ALL_CARRIERS)),
);
parent::__construct();
diff --git a/admin-dev/tabs/AdminImport.php b/admin-dev/tabs/AdminImport.php
index 8f5360439..13ebc669e 100644
--- a/admin-dev/tabs/AdminImport.php
+++ b/admin-dev/tabs/AdminImport.php
@@ -1191,6 +1191,10 @@ class AdminImport extends AdminTab
$info = self::getMaskedRow($line);
self::setDefaultValues($info);
+
+ if (array_key_exists('id', $info) AND (int)($info['id']) AND Manufacturer::existsInDatabase((int)($info['id'])))
+ $manufacturer = new Manufacturer((int)($info['id']));
+ else
$manufacturer = new Manufacturer();
self::array_walk($info, array('AdminImport', 'fillInfo'), $manufacturer);
@@ -1242,9 +1246,13 @@ class AdminImport extends AdminTab
$info = self::getMaskedRow($line);
self::setDefaultValues($info);
- $supplier = new Supplier();
- self::array_walk($info, array('AdminImport', 'fillInfo'), $supplier);
+ if (array_key_exists('id', $info) AND (int)($info['id']) AND Supplier::existsInDatabase((int)($info['id'])))
+ $supplier = new Supplier((int)($info['id']));
+ else
+ $supplier = new Supplier();
+
+ self::array_walk($info, array('AdminImport', 'fillInfo'), $supplier);
if (($fieldError = $supplier->validateFields(UNFRIENDLY_ERROR, true)) === true AND ($langFieldError = $supplier->validateFieldsLang(UNFRIENDLY_ERROR, true)) === true)
{
$res = false;
diff --git a/admin-dev/tabs/AdminInformation.php b/admin-dev/tabs/AdminInformation.php
index 6763d541b..55e0e9d19 100644
--- a/admin-dev/tabs/AdminInformation.php
+++ b/admin-dev/tabs/AdminInformation.php
@@ -293,7 +293,7 @@ class AdminInformation extends AdminTab
if ($recursive)
{
while (($file = readdir($dh)) !== false)
- if (@filetype($dir.$file) == 'dir' AND $file != '.' AND $file != '..')
+ if (is_dir($dir.$file) AND $file != '.' AND $file != '..')
if (!self::test_dir($dir.$file, true))
return false;
}
diff --git a/admin-dev/tabs/AdminProducts.php b/admin-dev/tabs/AdminProducts.php
index 946d3aceb..2231fb534 100644
--- a/admin-dev/tabs/AdminProducts.php
+++ b/admin-dev/tabs/AdminProducts.php
@@ -2726,19 +2726,27 @@ class AdminProducts extends AdminTab
|
'.$this->l('Please check a category in order to select the default category.').'
- ';
- if (Tools::isSubmit('categoryBox'))
+ ';
+ $default_category = Tools::getValue('id_category', 1);
+ if (!$obj->id)
{
- $postCat = Tools::getValue('categoryBox');
- $selectedCat = Category::getSimpleCategories($this->_defaultFormLanguage, false, true, 'AND c.`id_category` IN ('.(empty($postCat) ? '1' : implode(',', $postCat)).')');
- echo '';
+ $selectedCat = Category::getCategoryInformations(Tools::getValue('categoryBox', array($default_category)), $this->_defaultFormLanguage);
+ echo '
+ ';
}
- if ($obj->id)
+ else
+ {
+ if (Tools::isSubmit('categoryBox'))
+ $selectedCat = Category::getCategoryInformations(Tools::getValue('categoryBox', array($default_category)), $this->_defaultFormLanguage);
+ else
$selectedCat = Product::getProductCategoriesFull($obj->id, $this->_defaultFormLanguage);
- else if(!Tools::isSubmit('categoryBox'))
- $selectedCat[] = array('id_category' => 1, 'name' => $this->l('Home'));
- echo ' |