From 3ce7efd6ffad2aa99a6a1982d5a96ce726a8c6d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Neven=20Kajic=CC=81?= Date: Thu, 16 Mar 2017 17:14:55 +0100 Subject: [PATCH 1/2] magento/magento2#8590: M2.1.4 : ArrayBackend cannot save --- .../Eav/Model/Entity/Attribute/Backend/ArrayBackend.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Eav/Model/Entity/Attribute/Backend/ArrayBackend.php b/app/code/Magento/Eav/Model/Entity/Attribute/Backend/ArrayBackend.php index c387631e693cd..16eb425d6f4b1 100644 --- a/app/code/Magento/Eav/Model/Entity/Attribute/Backend/ArrayBackend.php +++ b/app/code/Magento/Eav/Model/Entity/Attribute/Backend/ArrayBackend.php @@ -23,7 +23,9 @@ public function beforeSave($object) $attributeCode = $this->getAttribute()->getAttributeCode(); $data = $object->getData($attributeCode); if (is_array($data)) { - $data = array_filter($data); + $data = array_filter($data, function ($value) { + return $value === '0' || !empty($value); + }); $object->setData($attributeCode, implode(',', $data)); } From 7bb1fb6142dcfbb6a2cc8ed5b2dcba359b19b210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Neven=20Kajic=CC=81?= Date: Thu, 16 Mar 2017 17:26:18 +0100 Subject: [PATCH 2/2] Added country regions for Croatia --- .../Magento/Directory/Setup/InstallData.php | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Directory/Setup/InstallData.php b/app/code/Magento/Directory/Setup/InstallData.php index ba259af6f8500..f193ae67cab9d 100644 --- a/app/code/Magento/Directory/Setup/InstallData.php +++ b/app/code/Magento/Directory/Setup/InstallData.php @@ -808,7 +808,28 @@ public function install(ModuleDataSetupInterface $setup, ModuleContextInterface ['BR', 'SP', 'São Paulo'], ['BR', 'SE', 'Sergipe'], ['BR', 'TO', 'Tocantins'], - ['BR', 'DF', 'Distrito Federal'] + ['BR', 'DF', 'Distrito Federal'], + ['HR', 'HR-01', 'Zagrebačka županija'], + ['HR', 'HR-02', 'Krapinsko-zagorska županija'], + ['HR', 'HR-03', 'Sisačko-moslavačka županija'], + ['HR', 'HR-04', 'Karlovačka županija'], + ['HR', 'HR-05', 'Varaždinska županija'], + ['HR', 'HR-06', 'Koprivničko-križevačka županija'], + ['HR', 'HR-07', 'Bjelovarsko-bilogorska županija'], + ['HR', 'HR-08', 'Primorsko-goranska županija'], + ['HR', 'HR-09', 'Ličko-senjska županija'], + ['HR', 'HR-10', 'Virovitičko-podravska županija'], + ['HR', 'HR-11', 'Požeško-slavonska županija'], + ['HR', 'HR-12', 'Brodsko-posavska županija'], + ['HR', 'HR-13', 'Zadarska županija'], + ['HR', 'HR-14', 'Osječko-baranjska županija'], + ['HR', 'HR-15', 'Šibensko-kninska županija'], + ['HR', 'HR-16', 'Vukovarsko-srijemska županija'], + ['HR', 'HR-17', 'Splitsko-dalmatinska županija'], + ['HR', 'HR-18', 'Istarska županija'], + ['HR', 'HR-19', 'Dubrovačko-neretvanska županija'], + ['HR', 'HR-20', 'Međimurska županija'], + ['HR', 'HR-21', 'Grad Zagreb'] ]; foreach ($data as $row) {