From 5c1917a8e85e8ff46b1a63d2c56b800496571f65 Mon Sep 17 00:00:00 2001 From: "m.korolev" Date: Thu, 30 Jan 2014 15:54:49 +0400 Subject: [PATCH] fix ICML Loading - check if is an array --- intaro.intarocrm/export/export_run.php | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/intaro.intarocrm/export/export_run.php b/intaro.intarocrm/export/export_run.php index 9bd68af7..23a67acd 100644 --- a/intaro.intarocrm/export/export_run.php +++ b/intaro.intarocrm/export/export_run.php @@ -26,14 +26,18 @@ foreach ($iblockProperties as $prop) { $skuUnitProps = ('IBLOCK_PROPERTY_UNIT_SKU' . "_" . $prop); $skuUnitProps = $$skuUnitProps; - foreach ($skuUnitProps as $iblock => $val) { - $IBLOCK_PROPERTY_UNIT_SKU[$iblock][$prop] = $val; + if (is_array($skuUnitProps)) { + foreach ($skuUnitProps as $iblock => $val) { + $IBLOCK_PROPERTY_UNIT_SKU[$iblock][$prop] = $val; + } } $skuProps = ('IBLOCK_PROPERTY_SKU' . "_" . $prop); $skuProps = $$skuProps; - foreach ($skuProps as $iblock => $val) { - $IBLOCK_PROPERTY_SKU[$iblock][$prop] = $val; + if (is_array($skuProps)) { + foreach ($skuProps as $iblock => $val) { + $IBLOCK_PROPERTY_SKU[$iblock][$prop] = $val; + } } } $IBLOCK_PROPERTY_PRODUCT = array(); @@ -42,14 +46,18 @@ foreach ($iblockProperties as $prop) { $productUnitProps = "IBLOCK_PROPERTY_UNIT_PRODUCT" . "_" . $prop; $productUnitProps = $$productUnitProps; - foreach ($productUnitProps as $iblock => $val) { - $IBLOCK_PROPERTY_UNIT_PRODUCT[$iblock][$prop] = $val; + if (is_array($productUnitProps)) { + foreach ($productUnitProps as $iblock => $val) { + $IBLOCK_PROPERTY_UNIT_PRODUCT[$iblock][$prop] = $val; + } } $productProps = "IBLOCK_PROPERTY_PRODUCT" . "_" . $prop; $productProps = $$productProps; - foreach ($productProps as $iblock => $val) { - $IBLOCK_PROPERTY_PRODUCT[$iblock][$prop] = $val; + if (is_array($productProps)) { + foreach ($productProps as $iblock => $val) { + $IBLOCK_PROPERTY_PRODUCT[$iblock][$prop] = $val; + } } }