Member
Member
benjancewicz   2008-05-11, 21:35
#1

Hello, I'm getting the following error both on my gallery pages and my image pages:

Warning: Invalid argument supplied for foreach() in /home/content/b/j/a/bjancewicz/html/ZenPhoto/zp-core/template-functions.php on line 177

I've tried to go through the entire template-functions.php doc to see if any brackets were missing or anything like that, but I don't see anything missing... does anything stick out to anyone else?

Here is line 177: `foreach ($_zp_plugin_scripts as $script) {'

Here is the whole template-functions.php

'

Member
Member
sbillard   2008-05-11, 23:27
#2

The most likely cause of this is that you did not update the root index.php file when you upgraded your installation. It is important to update all the files from the distribution when you upgrade.

Member
Member
tibonihoo   2008-05-19, 21:36
#3

I have a similar problem after an upgrade to 1.1.6, could this be caused by using a php5 specific feature (my host uses php4) ? Note that I don't know much about php, I've just read that the foreach function had accepted different arguments in php5...

Member
Member
sbillard   2008-05-19, 21:45
#4

The problem described above is caused by not having the 1.1.6 version if index.php. PHP 4 is just fine for zenphoto. Follow carefully the upgrade instructions. In fact, there is a video which shows exactly what to do. http://www.zenphoto.org/2008/04/watch-the-zenphoto-demonstration-videos/

Member
Member
tibonihoo   2008-05-21, 19:59
#5

I see, sorry about that...

Actually the problem I've encountered looked alike but is probably not the same: I've realized that my host only uses php 4.4.3 ... then I guess it's just a miracle that zenphoto-1.1.5 worked there (since the front page show php 4.10 as a requirement)

So in case anyone has a persistent problem with the foreach() loops begin given invalid arguments in version 1.1.6, it might be good to know that the previous version (1.1.5) [i]may[/i] work well anyway.

Member
Member
sbillard   2008-05-21, 22:20
#6

I doubt that there is a difference between 4.4.3 and 4.10 in terms of the foreach() function. Also, if zenphoto did not like your php level setup would have complained. So, maybe you can let us know the actual error you are getting.

Member
Member
tibonihoo   2008-05-29, 19:06
#7

ok I've made a fresh install as a test site, if you want to have a look it's there :
http://tibonihoo.free.fr/zenphoto/

However for other reasons, I've transfered my site on an other host, where the newest version of zenphot works pretty well (of course ). And I'm afraid I won't be able to help much on this.

Thanks for your replies !

Member
Member
sbillard   2008-05-29, 20:02
#8

OK, the only cause for the problem at http://tibonihoo.free.fr/zenphoto/ that I can see is if the glob() is disabled on the server. This may show up in a PHPinfo result. You can also change the SAFE_GLOB define at the beginning of functions.php to be true.

We can put a test in to prevent the error, but other things will not work right if glob() is not functioning.

Member
Member
tibonihoo   2008-05-31, 09:41
#9

Ok I've just tried to put SAVE_GLOB to true in the functions.php and it does not seem to resolve the problem. By the way the phpinfo is accessible there: http://tibonihoo.free.fr/info.php

Maybe you shouldn't lose too much time on this, though, especially if I'm the only one to have the problem, since my host recently messed up my db in a very strange way and I don't know what else they have done (my wordpress installation is also kind of broken and the db does not seem to be the only problem)

Member
Member
sbillard   2008-05-31, 16:19
#10

OK. If you wish, the nightly build has two things that might shed some light on this. First, it will not get the error as it tests to see if something has been returned from the call. Second, there is some tests now in setup.php to see if glob() is working.

Junior Member
Junior Member
NaWer   2008-06-11, 13:33
#11

Hi all

Same thing here, on the same host (free.fr) and put define('SAFE_GLOB', true); in function.php work like a charm

Thanks for zenphoto... really (u rock

Member
Member
Moderne Kunst   2009-07-25, 14:54
#12

Had the same problem with hostgator but now it works, thanks!

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.