Invalid argument supplied - default_item.php on line 16

GK User
Mon Dec 05, 2011 3:58 pm
Hey!

I get this message in front of every article on the frontpage.

Warning: Invalid argument supplied for foreach() in .../.../.../gk_game_magazine/html/com_content/featured/default_item.php on line 16
User avatar
Junior Boarder

teitbite
Tue Dec 06, 2011 1:18 am
Hi

Please try disable showing errors in joomla cglobal configuration for server. If this won't help than please send me FTP access.
User avatar
Moderator

GK User
Tue Dec 06, 2011 8:39 am
Where should I send the login details
User avatar
Junior Boarder

GK User
Wed Dec 07, 2011 10:42 pm
I also got this error on another site. Both of them has been migrated to joomla 1.7
User avatar
Junior Boarder

teitbite
Tue Dec 20, 2011 1:20 pm
Hi

Have You tried disabling the error showing. (It's warning not an error, so it's the fastest solution). Try also change it in php.ini. I believe modules are updated already, but maby a PHP version is not sufficient.
User avatar
Moderator

GK User
Fri Dec 23, 2011 12:05 am
If I turn the error warnings off it disappers. But isn't that more like putting the shit under the carpet? :/ You don't see it, but it is there.

PHP Version 5.3.3-7+squeeze3
Mysql 5.0.51a-24+lenny5-log
Joomla! 1.7.3 Stable [ Ember ] 14-Nov-2011 14:00 GMT

I have sent you login to one of the sites.
User avatar
Junior Boarder

teitbite
Fri Dec 23, 2011 1:08 am
Hi

Even joomla.org developers suggest to disable showing errors when site's leaving development process. It's because different PHP versions extentions are being written. With an older PHP version this warning will probably not show at all.

Anyway You can edit the file from warning and check if the param is an array befor the foreach statement occures. Something like this:

Code: Select all
if( !is_array( $param ) ) :
$param = array( $param );
endif;
User avatar
Moderator

teitbite
Fri Dec 23, 2011 1:37 pm
Hi

I've got an access to joomla panel in PM, but to change that I will need an access to FTP. Can You please send it to me ?
User avatar
Moderator

GK User
Fri Dec 30, 2011 4:34 am
[SOLVED]

I found out the error

When migrating from 1.5 to Joomla 1.7, the author did not migrate. So the author field was empty. By assigning an author, the error went away.
User avatar
Junior Boarder


cron