From e3172dc49e8a7c2548076222d47f4ca066678fd1 Mon Sep 17 00:00:00 2001 From: Aleksey Razbakov Date: Thu, 20 Oct 2016 19:34:51 +0200 Subject: [PATCH] fix Warning: array_merge() I've got this warning if I try to run `php hoimport.php -action line -profile profile_name -line 1`: ``` Getting source adapter ho_import/source_adapter_csv Warning: array_merge(): Argument #1 is not an array in app/code/community/Ho/Import/Model/Import.php on line 831 ``` `array_merge` expects first argument to be an array. `$arguments` can be string in case if line 825 was executed. --- app/code/community/Ho/Import/Model/Import.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/code/community/Ho/Import/Model/Import.php b/app/code/community/Ho/Import/Model/Import.php index 1e916dc..bbd9139 100644 --- a/app/code/community/Ho/Import/Model/Import.php +++ b/app/code/community/Ho/Import/Model/Import.php @@ -828,7 +828,9 @@ public function getSourceAdapter() $this->_runEvent('source_adapter_before', $this->getProfile()); $this->_getLog()->log($this->_getLog()->__('Getting source adapter %s', $source->getAttribute('model'))); $importData = $this->getImportData(); - $arguments = array_merge($arguments, is_null($importData) ? [] : $importData); + if (is_array($arguments)) { + $arguments = array_merge($arguments, is_null($importData) ? [] : $importData); + } $this->_sourceAdapter = Mage::getModel($source->getAttribute('model'), $arguments); if (!$this->_sourceAdapter) {