From 21f4e663cb7758cbdfc46cb3c545ece77200149e Mon Sep 17 00:00:00 2001 From: Anton Evers Date: Sun, 16 Jul 2017 16:30:27 +0600 Subject: [PATCH] Fix overwrite default value image/file with NULL If you set a default value for a config field type image/file and you save it. It won't set the default value in the database. Instead it will save NULL and so overwrite the default config. With this change the default value will be set as value. This is a replication of what used to be in of https://github.com/magento/magento2/pull/5085 --- app/code/Magento/Config/Model/Config/Backend/File.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/code/Magento/Config/Model/Config/Backend/File.php b/app/code/Magento/Config/Model/Config/Backend/File.php index 548239488efc7..f867c2edaccc7 100644 --- a/app/code/Magento/Config/Model/Config/Backend/File.php +++ b/app/code/Magento/Config/Model/Config/Backend/File.php @@ -110,6 +110,8 @@ public function beforeSave() } else { if (is_array($value) && !empty($value['delete'])) { $this->setValue(''); + } elseif (is_array($value) && !empty($value['value'])) { + $this->setValue($value['value']); } else { $this->unsValue(); }