﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc	mlocked
13533	Warning at /usr/share/mythtv/bindings/php/MythBackend.php, line 194:	Miroslav Pavlovic	gigem	"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"	Bug Report - General	closed	major	unknown	MythTV - Scheduling	v30-fixes	medium	Duplicate			0
