Error in agHelper.php

Admiror Gallery is free extension for Joomla! 1.6. Joomla! 1.7 and Joomla! 2.5 based websites. Admiror Gallery is all in one, a simple and instant solution for rendering image gallery from folder with images, but very flexible and adaptable.
Post Reply
Message
Author
jesus2014
Posts: 4
Joined: Mon Feb 10, 2014 6:19 pm

Error in agHelper.php

#1 Post 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 :)

Admiror Gallery 5 - Fundraising Campaign

User avatar
Vasiljevski
Developer
Developer
Posts: 1258
Joined: Sat Aug 14, 2010 9:31 pm
Location: Novi Sad, Serbia
Contact:

Re: Error in agHelper.php

#2 Post 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.
Help Admiror Gallery become even better,
give us a review on JED

jesus2014
Posts: 4
Joined: Mon Feb 10, 2014 6:19 pm

Re: Error in agHelper.php

#3 Post by jesus2014 »

Ok. Thank's for your reply
Now work's perfect !!

Thank you very much
Best regards

Post Reply