Opened 5 years ago

Closed 5 years ago

#13533 closed Bug Report - General (Duplicate)

Warning at /usr/share/mythtv/bindings/php/MythBackend.php, line 194:

Reported by: Miroslav Pavlovic Owned by: gigem
Priority: major Milestone: unknown
Component: MythTV - Scheduling Version: v30-fixes
Severity: medium Keywords:
Cc: Ticket locked: no

Description

kingmiro@mythxxx:~$ mythbackend --version Please attach all output as a file in bug reports. MythTV Version : v30.0 MythTV Branch : Network Protocol : 91 Library API : 30.20181231-1 QT Version : 5.9.5 Options compiled in:


Problem: When scheduling a new recording from the (for example) Listings, I am always getting the Error message at the top:

Warning at /usr/share/mythtv/bindings/php/MythBackend.php, line 194: !NoTrans: count(): Parameter must be an array or an object that implements Countable!!


Info: The issue is appearing, but still the schedule can be set.


Solution: I have tested this solution, that was provided by daraden in this thread: https://forum.mythtv.org/viewtopic.php?t=2815

I may have found a possible solution to this issue. looks like replacing line 194

Code: Select all

$count = count($records);

with

Code: Select all

if (is_array($records)) $count = count($records); else $count = 0;

may resolve this issue in PHP 7.2. Not a PHP programmer so I'm not aware of any issues with implementing this solution.

After modifying this line, I do not get the Error presented any more, but with every update the file: /usr/share/mythtv/bindings/php/MythBackend.php is getting overwritten and I have to add it again.

Please add this quick fix to the code, so it gets fixed with a future update.

Thanks a lot!

Cheers, Miro

Change History (1)

comment:1 Changed 5 years ago by Bill Meek

Resolution: Duplicate
Status: newclosed

Fixed in #13406

Note: See TracTickets for help on using tickets.