Page 1 of 1

Error in agHelper.php

Posted: Mon Feb 10, 2014 6:27 pm
by jesus2014
Hi !!

I have an error in my page:

"Warning: array_diff(): Argument #2 is not an array in /web/htdocs/www.moltapastaimes.com/home/plugins/con ... Helper.php on line 216"

Please, can you say me how tou solve it ¿?

The URL is:
http://www.moltapastaimes.com/index.php ... Itemid=163

I wait your reply

Thank you very much
Best regards :)

Re: Error in agHelper.php

Posted: Mon Feb 10, 2014 8:00 pm
by Vasiljevski
Can you change:

Code: Select all

			$diffArray = array_diff($thumbs, $origin);
			if ($diffArray != null) {
				foreach ($diffArray as $diffFolder) {
					agHelper::ag_sureRemoveDir($thumbFolder . $diffFolder, true);
				}
			}
to

Code: Select all

	if(!empty($thumbs) && !empty($origin))
		{
			$diffArray = array_diff($thumbs, $origin);
			if ($diffArray != null) {
				foreach ($diffArray as $diffFolder) {
					agHelper::ag_sureRemoveDir($thumbFolder . $diffFolder, true);
				}
			}
		}
I'm not sure why do you have this Warning, but checking if variable is empty before diff the arrays should prevent the warning from poping up.

Re: Error in agHelper.php

Posted: Thu Feb 27, 2014 10:28 pm
by jesus2014
Ok. Thank's for your reply
Now work's perfect !!

Thank you very much
Best regards