diff --git a/classes/Supplier.php b/classes/Supplier.php index 6f2beeb07..8a4b1390f 100644 --- a/classes/Supplier.php +++ b/classes/Supplier.php @@ -59,12 +59,6 @@ class SupplierCore extends ObjectModel /** @var boolean active */ public $active; - /** - * @since 1.5.0 - * @var int address - * */ - public $id_address; - /** * @see ObjectModel::$definition */ @@ -74,7 +68,6 @@ class SupplierCore extends ObjectModel 'multilang' => true, 'fields' => array( 'name' => array('type' => self::TYPE_STRING, 'validate' => 'isCatalogName', 'required' => true, 'size' => 64), - 'id_address' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'active' => array('type' => self::TYPE_BOOL), 'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'), 'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'), diff --git a/controllers/admin/AdminSuppliersController.php b/controllers/admin/AdminSuppliersController.php index fe083a471..b7d239259 100644 --- a/controllers/admin/AdminSuppliersController.php +++ b/controllers/admin/AdminSuppliersController.php @@ -214,8 +214,12 @@ class AdminSuppliersControllerCore extends AdminController // loads current address for this supplier - if possible $address = null; - if ($obj->id_address > 0) - $address = new Address($obj->id_address); + + $id_address = Address::getAddressIdBySupplierId($obj->id); + + if ($id_address > 0) + $address = new Address((int)$id_address); + // force specific fields values (address) if ($address != null) { diff --git a/install-dev/fixtures/apple/data/address.xml b/install-dev/fixtures/apple/data/address.xml index 8a2b5ae7b..ae9278252 100644 --- a/install-dev/fixtures/apple/data/address.xml +++ b/install-dev/fixtures/apple/data/address.xml @@ -29,11 +29,23 @@ Cupertino -
- 16, Main street - 2nd floor - Paris - -
+
+ 16, Main street + 2nd floor + Paris + +
+
+ 767 Fifth Ave. + + New York + +
+
+ 5800 W. Touhy Ave + + Niles + +
diff --git a/install-dev/upgrade/sql/1.5.0.10.sql b/install-dev/upgrade/sql/1.5.0.10.sql index 21dd5e8b4..1492d9fee 100644 --- a/install-dev/upgrade/sql/1.5.0.10.sql +++ b/install-dev/upgrade/sql/1.5.0.10.sql @@ -1 +1 @@ -/* PHP:module_blockwishlist_multishop(); */; +/* PHP:module_blockwishlist_multishop(); */; \ No newline at end of file