From cb5e253737a06b462841e16ecf01f56d840c5471 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Jag=C5=82a?= Date: Fri, 28 Feb 2020 18:57:36 +0100 Subject: [PATCH] Fixes saving slider with deselected all Locations --- Model/ResourceModel/Slider.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Model/ResourceModel/Slider.php b/Model/ResourceModel/Slider.php index 3312b3f..e9566c9 100644 --- a/Model/ResourceModel/Slider.php +++ b/Model/ResourceModel/Slider.php @@ -129,10 +129,8 @@ protected function _beforeSave(AbstractModel $object) $object->setCreatedAt($this->date->date()); } - $location = $object->getLocation(); - if (is_array($location)) { - $object->setLocation(implode(',', $location)); - } + $location = (array)$object->getLocation(); + $object->setLocation(implode(',', $location)); $storeIds = $object->getStoreIds(); if (is_array($storeIds)) {