Modify

Ticket #10142 (closed Patch - Bug Fix: fixed)

Opened 19 months ago

Last modified 6 weeks ago

Prevent PHP warning in upcoming.php due to wrong datatype in foreach

Reported by: Philipp Wagner <mail@…> Owned by: kormoc
Priority: minor Milestone: 0.27
Component: Plugin - MythWeb Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: yes

Description

At /tv/upcoming I get the following PHP warning:


Warning at /usr/share/mythtv/mythweb/modules/tv/upcoming.php, line 96: !NoTrans: Invalid argument supplied for foreach()!!

Warning at /usr/share/mythtv/mythweb/modules/_shared/tmpl/default/header.php, line 16: !NoTrans: Cannot modify header information - headers already sent by (output started at /usr/share/mythtv/mythweb/includes/errors.php:150)!!


It seems that the code tried to prevent that, but somehow it didn't get a full fix ($scheduled is unused). Trivial patch attached.

I am running 0.24.1 here, but it seems that the code is the same in the git master.

Attachments

mythweb-php-warning.patch (617 bytes) - added by Philipp Wagner <mail@…> 19 months ago.
mythweb-php-warning-pt2.patch (629 bytes) - added by Philipp Wagner <mail@…> 19 months ago.
Fixing same problem in detail.php
0001-fix-findSchedules-returning-undefind-as-array.patch (608 bytes) - added by anonymous 16 months ago.

Change History

Changed 19 months ago by Philipp Wagner <mail@…>

Changed 19 months ago by Philipp Wagner <mail@…>

Fixing same problem in detail.php

comment:1 Changed 19 months ago by Philipp Wagner <mail@…>

I just found that detail.php has the same problem; I hope it's ok to add this to this bug report, otherwise I'm happy to open a new one or attach an combined patch if that's easier for you.

comment:2 Changed 16 months ago by anders@…

Has this bug been fixed...? Tryed to change my php files but they couldend load after change.

comment:3 Changed 16 months ago by mail@…

No, as far as I know the patches have not been applied. I have no idea how the process to get a patch applied is supposed to work in MythTV.

comment:4 Changed 16 months ago by anders@…

What a shame...pretty irritating :P

comment:5 Changed 16 months ago by robertm

  • Ticket locked set

irritating indeed.

comment:6 Changed 16 months ago by mdean

  • Ticket locked unset

Unlocking to allow uploading another patch. Please keep discussion out of the bug tracker so we don't have to lock the ticket, again.

Changed 16 months ago by anonymous

comment:7 Changed 12 months ago by christian.wittrock@…

Hi, The problem occurred in my new 12.04 installation today. The "fix" listed here does not correct the problem that I have. Of course it takes care of the web error, but it does not solve the real problem. It hides it. What I see is that scheduling does not work at all. I can see from the list that there are programs that the scheduler should find but it doesn't. Even the programs that were part of the scheduled recordings (visible yesterday) have disappeared. I have all the latest updates installed. Please advice if I should retrieve any information from a log.

comment:8 Changed 12 months ago by christian.wittrock@…

Update... After I cleaned out some bad recordings, removed some unwanted custom schedules, added the fix and rebooted the scheduler seemed to come alive again...

comment:9 Changed 12 months ago by a-j@…

Just want to report I had the same warning (NoTrans?: Invalid argument supplied for foreach)in detail.php on a fresh install of MythTV 0.25-fixes and the latest MythWeb from git. Applying the patch provided by Philipp in the beginning of this ticket fixed it for me. Thanks!

comment:10 Changed 9 months ago by christian.wittrock@…

Hi,

as this bug kills the scheduler and pretty much renders MythTV useless, I suggest to change the priority to critical and get the fix released.

The issue seems to occur whenever EPG data is missing from a channel, which is a common situation.

I had to re-install 12.04 because it crashed terminally, and now I have again run into this bug. So, please get this patch released.

comment:11 Changed 9 months ago by kenni

  • Ticket locked set

There's no way this bug could have killed your OS...and as stated before, please keep disussions (and posts which add no value to the report), out of the report.

comment:12 Changed 8 months ago by kenni

Refs. #9967

comment:13 Changed 8 weeks ago by Rob Smith <kormoc@…>

  • Status changed from new to closed
  • Resolution set to fixed

In d8b1f404bc0f51a7aff72202713ffc198755a37b/mythweb:

Fixes #10142, this ensures we return an empty array rather then null when there are no scheduled recordings

comment:14 Changed 6 weeks ago by wagnerrp

  • Milestone changed from unknown to 0.27
View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.