ZenphotoCMS Forum
getNumNews : warning in debug log - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: getNumNews : warning in debug log (/thread-10686.html)



getNumNews : warning in debug log - vincent3569 - 2012-12-30

hi

with Zenphoto version 1.4.3.5 [11059], I have a lot of this warning in my debug log :
Backtrace: WARNING: Invalid argument supplied for foreach() in .../zenphoto/zp-core/zp-extensions/zenpage/zenpage-class-news.php on line 144 ZenpageNews->categoryIsVisible called from Zenpage->getArticles (zenpage-class.php [263]) from getNumNews (zenpage-template-functions.php [205]) from include (inc_header.php [285]) from include (pages.php [1]) from include (index.php [5]) from index.php [92]
do you have an idea about this message ?




getNumNews : warning in debug log - sbillard - 2012-12-30

It appears a bug if you call this function on an article which is in no categories.




getNumNews : warning in debug log - vincent3569 - 2012-12-31

I have a look on articles of my website.
All of them have at least one categorie.




getNumNews : warning in debug log - sbillard - 2012-12-31

The problem will occur if any SQL error occurs on the query, so maybe some other thing was in error.