[mythtv-users] MythWEB foreach error on recording statistics webpage

kareemy kareemy at gmail.com
Sat Feb 10 03:42:12 UTC 2007

Using mythplugins 0.20a I get the following php error on the recording
statistics page of mythweb:

*Error* at /srv/www/htdocs/mythweb/modules/stats/tmpl/default/stats.php,
line 87:
Invalid argument supplied for foreach()

*Error* at /srv/www/htdocs/mythweb/modules/stats/tmpl/default/stats.php,
line 114:
Invalid argument supplied for foreach()

It appears to be because $top_ten_shows and $top_ten_chans are not set. I
added a check and right before the foreach loop isset($top_ten_shows)
returns false. This is most probably because I have no shows recorded and
haven't used mythtv yet. Infact the same page displays:

First recording: Wednesday December 31st, 1969To fix the problem, I just
added an if (isset($top_ten_shows) { .. } and if (isset($top_ten_chans) {
... } surrounding each foreach loop. I'm not sure that is the best fix but I
just wanted to let the developers know.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mythtv.org/pipermail/mythtv-users/attachments/20070209/b5ed9e1a/attachment.htm 

More information about the mythtv-users mailing list