Opened 17 years ago

Closed 17 years ago

#3116 closed defect (fixed)

Mythweb Stats errors when there are no oldrecordings

Reported by: Rob Smith Owned by: Rob Smith
Priority: trivial Milestone: unknown
Component: mythweb Version: head
Severity: low Keywords:
Cc: Ticket locked: no

Description

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.

Thanks,
Kareem 

Change History (2)

comment:1 Changed 17 years ago by Rob Smith

Owner: changed from xris to Rob Smith

comment:2 Changed 17 years ago by Rob Smith

Resolution: fixed
Status: newclosed

(In [13033]) Fixes #3116, this disables the stats module when there are no old recordings. Seems silly to show it blank

Note: See TracTickets for help on using tickets.