0

I'm not sure if anyone met the same error as me. When I'm trying to import product information into Magento via Magmi, I found the following error.

Illegal offset type in /var/www/magmi/plugins/5b5/general/attributesetimport/multi_dim_array.php on line 58

3
  • I'd like to see you csv form!
    – 3CE
    Mar 27, 2017 at 18:27
  • Here is a part of CSV data. (our project is in Japanese) Mar 28, 2017 at 8:31
  • Here is a part of CSV data. (Sorry I'm new to StackExchange, still don't know how to attache picture yet.). The 1st line is field name, and 2nd line is data store,websites,attribute_set,type,category_ids,sku,has_options,name,meta_title, ... admin,base,Default,simple,23,bg-325860-814091,1,Retro Vintage Airman's Rucksack,フォックスアウトドア Fox Outdoor バッグ バックパック・リュック ラップトップ【Retro Vintage Airman's Rucksack】, ... Mar 28, 2017 at 8:38

1 Answer 1

0

I can't find any errors in your csv form. Could you compare this code with yours?

    /**
 * (non-PHPdoc)
 * @see ArrayIterator::offsetGet()
 */
public function offsetGet($name)
{
    if (!is_array($name)) {
        return parent::offsetGet($name);
    } else {
        $key = array_shift($name);
        if (!parent::offsetExists($key)) {
            return null;
        }
        $element = parent::offsetGet($key);
        if (sizeof($name) == 0) {
            return $element;
        } else {
            if (is_a($element, 'MultiDimArray')) {
                return $element->offsetGet($name);
            } else {
                return $element;
            }
        }
    }
}

/**
 * (non-PHPdoc)
 * @see ArrayIterator::offsetSet()
 */
public function offsetSet($name, $value)
{
    if (!is_array($name)) {
        return parent::offsetSet($name, $value);
    } else {
        $key = array_shift($name);
        if (sizeof($name) == 0) {
            parent::offsetSet($key, $value);
        } else {
            $childArray = parent::offsetExists($key)?parent::offsetGet($key):new MultiDimArray();
            if (!is_a($childArray, 'MultiDimArray')) {
                $childArray = new MultiDimArray();
            }
            parent::offsetSet($key, $childArray);
            $childArray->offsetSet($name, $value);
        }
    }
}

If it is same, you remove below this code temporarily

if (!parent::offsetExists($key)) {
     return null;
  }
1
  • The code are the same after compare. I followed your comment temporary remove the code, but it still the same error. Do you have any idea ? Mar 29, 2017 at 4:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.