0

I have this problem in my Joomla installation.

Warning: Invalid argument supplied for foreach() components/com_content/models/frontpage.php on line 104

I tried to google this error but nothing that could solve my problem came up. Somehow this error is causing my template to break and it fails to load some parts of it.

Error is not visible on front end of website, but it shows up in error_log.

Vuk Stanković
  • 7,864
  • 10
  • 41
  • 65
  • It means that on line `104` in `components/com_content/models/frontpage.php` you are missing an array! – Mihai Iorga Sep 05 '12 at 11:28
  • I know that, but do you have any idea what can cause this? I've tried looking at my error_log file. Actualy this error isn't showing up on website, but template breaks apart, and it won't load some parts – Vuk Stanković Sep 05 '12 at 11:32
  • Have never seen this error on a fresh installation of Joomla 1.5.x. What's the exact version you're of the Joomla 1.5 series? – Lodder Sep 06 '12 at 03:10
  • It's Joomla 1.5.26. I think it has something to do with JoomlArt T3 Framework, and JA_Anion theme. When I change theme to some other, there is no error – Vuk Stanković Sep 07 '12 at 08:23

2 Answers2

1

There is probably no content on your front page which causes the foreach to throw this warning.

$Arows = $this->_getList($query, $limitstart, $limit);
...
foreach ($Arows as $row)
...

Assign an item (article) to the front page and check again.

Martin Müller
  • 2,565
  • 21
  • 32
  • +1 probably that, or else a more generic database problem is preventing fetching any rows - see also http://forum.joomla.org/viewtopic.php?f=428&t=452303 and http://x10hosting.com/forums/free-hosting/100569-mysql-error-cant-create-write-file.html – Colin Pickard Sep 05 '12 at 11:34
  • I have content on my front page. You can see it here http://estiem.org.rs/ Maybe you can get a better picture than I can – Vuk Stanković Sep 05 '12 at 11:35
  • Aha, there is a 2nd error. "mysql_num_rows(): supplied argument is not a valid MySQL result resource"... This means your connection to the database is not working correctly. Probably the problem Colin Pickard pointed out. – Martin Müller Sep 05 '12 at 11:38
0

It means the argument isn't an array or object.

You can skip the foreach by using is_array or is_object to test if it's an array first and only execute when there's something there.

Mark
  • 3,005
  • 1
  • 21
  • 30