Jump to content

array_merge()


Guest

Recommended Posts

Hi,

I just installed CC3 and I´m getting this error message in Admin when I try to add more images to a product and in the file manager:

Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /home/domain/public_html/shop/includes/functions.inc.php on line 158.

Any ideas?

Link to comment
Share on other sites

I did this and it worked for me.

//////////////////////////////////

// Walk through files and folders in directory

////////

function walk_dir($path, $oneLevel=1) {

	if ($dir = opendir($path)) {

  while (false !== ($file = readdir($dir)))

  {

 	 if ($file[0]==".") continue;

 	 if (is_dir($path."/".$file) AND  $oneLevel==1)

 	 {

    if(is_array($retval))

    {

   	 $retval = array_merge($retval,walk_dir($path."/".$file));

    }else{

   	 $retval = walk_dir($path."/".$file);

    }

  }

 	 else if (is_file($path."/".$file))

    $retval[]=$path."/".$file;

 	 }

  closedir($dir);

  }

	return $retval;

}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...