Opened 6 years ago
Closed 6 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)
Note:
See TracTickets
for help on using tickets.

This has been resolved.