Opened 4 years ago

Closed 4 years ago

#13572 closed Bug Report - General (Fixed)

Mythweb PHP 7.4 Error - Creating default object from empty value

Reported by: Steve Tremayne Owned by: Bill Meek
Priority: minor Milestone: 31.0
Component: Plugin - MythWeb Version: v30-fixes
Severity: medium Keywords:
Cc: Ticket locked: no

Description

Discussed in the forum: https://forum.mythtv.org/viewtopic.php?f=36&t=3553

MythTV 30.0 running on Arch Linux

Basically, upgrading PHP to 7.4 produced a lot of errors on the MythWeb page:

It seems like the following error is shown for every TV channel on the TV Schedule (Listings) page:

Warning at /var/lib/mythtv/mythweb/modules/tv/includes/programs.php, line 204:
!!NoTrans: Creating default object from empty value!!

(In my case, this was ~100 times, so several pages were just error messages)

Patch shown in forum post appears to resolve this issue:

--- programs.php.ori    2019-12-11 22:16:57.423529528 +0100
+++ programs.php        2019-12-11 22:55:37.649127471 +0100
@@ -201,6 +201,11 @@
             }
         // Add this program to the channel hash, etc.
             $these_programs[]                          =& $program;
+
+            // Creating default object from empty value php warning
+            $channel_hash[$data['chanid']] = new stdClass();
+            
             $channel_hash[$data['chanid']]->programs[] =& $program;
         // Cleanup
             unset($program);

Change History (2)

comment:1 Changed 4 years ago by Bill Meek

Milestone: needs_triage31.0
Owner: changed from Stuart Auchterlonie to Bill Meek
Status: newaccepted

comment:2 Changed 4 years ago by Stuart Auchterlonie

Resolution: Fixed
Status: acceptedclosed

This has been resolved.

Note: See TracTickets for help on using tickets.