!!NoTrans: count(): Parameter must be an array or an object that implements Countable!!
Moderator: Forum Moderators
!!NoTrans: count(): Parameter must be an array or an object that implements Countable!!
I am getting some mythweb errors on the Schedule a recording page.
Warning at /usr/share/mythtv/bindings/php/MythBackend.php, line 194:
!!NoTrans: count(): Parameter must be an array or an object that implements Countable!!
They don't seem to be causing any problems so far that I have noticed but not positive.
Fresh install of Xubuntu 18.04.1
MythTV Version : v29.1-38-gb9c5f8b
MythTV Branch : fixes/29
Network Protocol : 91
Library API : 29.20180316-1
QT Version : 5.9.5
Warning at /usr/share/mythtv/bindings/php/MythBackend.php, line 194:
!!NoTrans: count(): Parameter must be an array or an object that implements Countable!!
They don't seem to be causing any problems so far that I have noticed but not positive.
Fresh install of Xubuntu 18.04.1
MythTV Version : v29.1-38-gb9c5f8b
MythTV Branch : fixes/29
Network Protocol : 91
Library API : 29.20180316-1
QT Version : 5.9.5
Re: !!NoTrans: count(): Parameter must be an array or an object that implements Countable!!
Thanks, I had seen that and there wasn't a fix. The original problem in the link you provided was that Mythweb wouldn't start and the changes that are listed in the fix to recorded.php were already included in my install.
Re: !!NoTrans: count(): Parameter must be an array or an object that implements Countable!!
A Google search indicates this may be an issue with PHP 7.2 which is what I have with Xubuntu 18.04.1
I suppose I should report this.
I suppose I should report this.
Re: !!NoTrans: count(): Parameter must be an array or an object that implements Countable!!
Hi,
You're right, there were a couple of issues in that thread. Just to be clear, what
is the output of:
You're right, there were a couple of issues in that thread. Just to be clear, what
is the output of:
Code: Select all
ls -ld /etc/apache2/mods-enabled/php7.2*
Re: !!NoTrans: count(): Parameter must be an array or an object that implements Countable!!
ls -ld /etc/apache2/mods-enabled/php7.2*
lrwxrwxrwx 1 root root 29 Sep 21 20:41 /etc/apache2/mods-enabled/php7.2.conf -> ../mods-available/php7.2.conf
lrwxrwxrwx 1 root root 29 Sep 21 20:41 /etc/apache2/mods-enabled/php7.2.load -> ../mods-available/php7.2.load
lrwxrwxrwx 1 root root 29 Sep 21 20:41 /etc/apache2/mods-enabled/php7.2.conf -> ../mods-available/php7.2.conf
lrwxrwxrwx 1 root root 29 Sep 21 20:41 /etc/apache2/mods-enabled/php7.2.load -> ../mods-available/php7.2.load
Re: !!NoTrans: count(): Parameter must be an array or an object that implements Countable!!
I may have found a possible solution to this issue. looks like replacing line 194 with may resolve this issue in PHP 7.2. Not a PHP programmer so I'm not aware of any issues with implementing this solution.
Code: Select all
$count = count($records);
Code: Select all
if (is_array($records)) $count = count($records);
else $count = 0;
Re: !!NoTrans: count(): Parameter must be an array or an object that implements Countable!!
Thanks. I made the change and that does make the error message go away. If there was, in fact, a real underlying issue I didn't see anything very obvious. I will keep watch and update this if there are any issues.
If you don't mind I will add this as a comment to my bug report with reference to your post.
If you don't mind I will add this as a comment to my bug report with reference to your post.
Re: !!NoTrans: count(): Parameter must be an array or an object that implements Countable!!
the count() error is listed in the PHP manual as an incompatible change in 7.2https://secure.php.net/manual/en/migrat ... atible.php. Basically in previous versions the code produced the desired result, but probably should have been an error and in 7.2 it is an error.
This error is likely to pop up in a few places throughout the Mythweb code. I have made a similar change to the recording details page to deal with having an empty job queue entry.
This should also work and run slightly faster. The previous change just seems more correct to me. Both should be compatible with earlier versions of PHP:
This error is likely to pop up in a few places throughout the Mythweb code. I have made a similar change to the recording details page to deal with having an empty job queue entry.
This should also work and run slightly faster. The previous change just seems more correct to me. Both should be compatible with earlier versions of PHP:
Code: Select all
if ($records) $count = count($records);
else $count = 0;