Mailing List Archive

Ticket #13406: Patches to fix php count warnings with PHP 7.2
#13406: Patches to fix php count warnings with PHP 7.2
----------------------------------+---------------------------------
Reporter: daraden | Owner: Stuart Auchterlonie
Type: Patch - Bug Fix | Status: new
Priority: minor | Milestone: needs_triage
Component: Plugin - MythWeb | Version: Master Head
Severity: low | Keywords:
Ticket locked: 0 |
----------------------------------+---------------------------------
These patches are to resolve count() warnings when using PHP 7.2. Changes
just check if the object is not null before calling the count function,
otherwise the count variable is set to 0.

link to PHP manual noting the count() behavior as an incompatible change
in PHP 7.2[https://secure.php.net/manual/en/migration72.incompatible.php]

--
Ticket URL: <https://code.mythtv.org/trac/ticket/13406>
MythTV <http://www.mythtv.org>
MythTV Media Center
Re: Ticket #13406: Patches to fix php count warnings with PHP 7.2 [ In reply to ]
#13406: Patches to fix php count warnings with PHP 7.2
------------------------------+-------------------------------------
Reporter: daraden | Owner: Stuart Auchterlonie
Type: Patch - Bug Fix | Status: new
Priority: minor | Milestone: needs_triage
Component: Plugin - MythWeb | Version: Master Head
Severity: low | Resolution:
Keywords: | Ticket locked: 0
------------------------------+-------------------------------------
Changes (by daraden):

* Attachment "mythwebcount.patch" added.

mythweb count warning patch

--
Ticket URL: <https://code.mythtv.org/trac/ticket/13406>
MythTV <http://www.mythtv.org>
MythTV Media Center
Re: Ticket #13406: Patches to fix php count warnings with PHP 7.2 [ In reply to ]
#13406: Patches to fix php count warnings with PHP 7.2
------------------------------+-------------------------------------
Reporter: daraden | Owner: Stuart Auchterlonie
Type: Patch - Bug Fix | Status: new
Priority: minor | Milestone: needs_triage
Component: Plugin - MythWeb | Version: Master Head
Severity: low | Resolution:
Keywords: | Ticket locked: 0
------------------------------+-------------------------------------
Changes (by daraden):

* Attachment "mythcount.patch" added.

mythtv php bindings count patch

--
Ticket URL: <https://code.mythtv.org/trac/ticket/13406>
MythTV <http://www.mythtv.org>
MythTV Media Center
Re: Ticket #13406: Patches to fix php count warnings with PHP 7.2 [ In reply to ]
#13406: Patches to fix php count warnings with PHP 7.2
------------------------------+-------------------------------------
Reporter: daraden | Owner: Stuart Auchterlonie
Type: Patch - Bug Fix | Status: new
Priority: minor | Milestone: needs_triage
Component: Plugin - MythWeb | Version: Master Head
Severity: low | Resolution:
Keywords: | Ticket locked: 0
------------------------------+-------------------------------------

Comment (by Peter Bennett):

See also #13324, #13290

--
Ticket URL: <https://code.mythtv.org/trac/ticket/13406#comment:1>
MythTV <http://www.mythtv.org>
MythTV Media Center
Re: Ticket #13406: Patches to fix php count warnings with PHP 7.2 [ In reply to ]
#13406: Patches to fix php count warnings with PHP 7.2
------------------------------+-------------------------------------
Reporter: daraden | Owner: Stuart Auchterlonie
Type: Patch - Bug Fix | Status: accepted
Priority: minor | Milestone: 30.1
Component: Plugin - MythWeb | Version: Master Head
Severity: low | Resolution:
Keywords: | Ticket locked: 0
------------------------------+-------------------------------------
Changes (by Stuart Auchterlonie):

* status: new => accepted
* milestone: needs_triage => 30.1


Comment:

Needs backporting to fixes/29 and fixes/30

--
Ticket URL: <https://code.mythtv.org/trac/ticket/13406#comment:2>
MythTV <http://www.mythtv.org>
MythTV Media Center
Re: Ticket #13406: Patches to fix php count warnings with PHP 7.2 [ In reply to ]
#13406: Patches to fix php count warnings with PHP 7.2
------------------------------+-------------------------------------
Reporter: daraden | Owner: Stuart Auchterlonie
Type: Patch - Bug Fix | Status: accepted
Priority: minor | Milestone: 30.1
Component: Plugin - MythWeb | Version: Master Head
Severity: low | Resolution:
Keywords: | Ticket locked: 0
------------------------------+-------------------------------------

Comment (by hobbes1069):

Don't know if it's the right way but I "fixed" this on Fedora using the
following:

{{{
iff --git a/modules/tv/tmpl/default/detail.php
b/modules/tv/tmpl/default/detail.php
index f6d1faa9..4975f415 100644
--- a/modules/tv/tmpl/default/detail.php
+++ b/modules/tv/tmpl/default/detail.php
@@ -842,7 +842,7 @@
}
echo ' </ul>';
}
- if (count($program->jobs['queue'])) {
+ if (is_array($program->jobs['queue']) &&
count($program->jobs['queue'])) {
echo t('Queued jobs'), ':',
' <ul class="-queued">';
foreach ($program->jobs['queue'] as $job) {
@@ -856,7 +856,7 @@
}
echo ' </ul>';
}
- if (count($program->jobs['done'])) {
+ if (is_array($program->jobs['done']) &&
count($program->jobs['done'])) {
echo t('Recently completed jobs'), ':',
' <ul class="-done">';
foreach ($program->jobs['done'] as $job) {

}}}

--
Ticket URL: <https://code.mythtv.org/trac/ticket/13406#comment:3>
MythTV <http://www.mythtv.org>
MythTV Media Center
Re: Ticket #13406: Patches to fix php count warnings with PHP 7.2 [ In reply to ]
#13406: Patches to fix php count warnings with PHP 7.2
------------------------------+-------------------------------------
Reporter: daraden | Owner: Stuart Auchterlonie
Type: Patch - Bug Fix | Status: accepted
Priority: minor | Milestone: 30.1
Component: Plugin - MythWeb | Version: Master Head
Severity: low | Resolution:
Keywords: | Ticket locked: 0
------------------------------+-------------------------------------

Comment (by hobbes1069):

Would it be safe to apply the two patches to v30? I would like to fix this
for Fedora / RPM Fusion.

--
Ticket URL: <https://code.mythtv.org/trac/ticket/13406#comment:4>
MythTV <http://www.mythtv.org>
MythTV Media Center
Re: Ticket #13406: Patches to fix php count warnings with PHP 7.2 [ In reply to ]
#13406: Patches to fix php count warnings with PHP 7.2
------------------------------+-------------------------------------
Reporter: daraden | Owner: Stuart Auchterlonie
Type: Patch - Bug Fix | Status: accepted
Priority: minor | Milestone: 30.1
Component: Plugin - MythWeb | Version: Master Head
Severity: low | Resolution:
Keywords: | Ticket locked: 0
------------------------------+-------------------------------------
Changes (by daraden):

* Attachment "mythwebcount.patch" added.

fixed typo in mythwebcount.patch

--
Ticket URL: <https://code.mythtv.org/trac/ticket/13406>
MythTV <http://www.mythtv.org>
MythTV Media Center
Re: Ticket #13406: Patches to fix php count warnings with PHP 7.2 [ In reply to ]
#13406: Patches to fix php count warnings with PHP 7.2
------------------------------+-------------------------------------
Reporter: daraden | Owner: Stuart Auchterlonie
Type: Patch - Bug Fix | Status: accepted
Priority: minor | Milestone: 30.1
Component: Plugin - MythWeb | Version: Master Head
Severity: low | Resolution:
Keywords: | Ticket locked: 0
------------------------------+-------------------------------------
Changes (by daraden):

* Attachment "mythwebcount.patch" removed.

mythweb count warning patch

--
Ticket URL: <https://code.mythtv.org/trac/ticket/13406>
MythTV <http://www.mythtv.org>
MythTV Media Center
Re: Ticket #13406: Patches to fix php count warnings with PHP 7.2 [ In reply to ]
#13406: Patches to fix php count warnings with PHP 7.2
------------------------------+-------------------------------------
Reporter: daraden | Owner: Stuart Auchterlonie
Type: Patch - Bug Fix | Status: accepted
Priority: minor | Milestone: 30.1
Component: Plugin - MythWeb | Version: Master Head
Severity: low | Resolution:
Keywords: | Ticket locked: 0
------------------------------+-------------------------------------

Comment (by daraden):

Should work fine with v30(patches are working on my 29 backend). files the
patches modify are listed as last modified 2 or more years ago.

--
Ticket URL: <https://code.mythtv.org/trac/ticket/13406#comment:5>
MythTV <http://www.mythtv.org>
MythTV Media Center
Re: Ticket #13406: Patches to fix php count warnings with PHP 7.2 [ In reply to ]
#13406: Patches to fix php count warnings with PHP 7.2
------------------------------+-------------------------------------
Reporter: daraden | Owner: Stuart Auchterlonie
Type: Patch - Bug Fix | Status: accepted
Priority: minor | Milestone: 30.1
Component: Plugin - MythWeb | Version: Master Head
Severity: low | Resolution:
Keywords: | Ticket locked: 0
------------------------------+-------------------------------------

Comment (by jr3us):

The count error also affects the file Mythbackend.php as follows:

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

--
Ticket URL: <https://code.mythtv.org/trac/ticket/13406#comment:6>
MythTV <http://www.mythtv.org>
MythTV Media Center
Re: Ticket #13406: Patches to fix php count warnings with PHP 7.2 [ In reply to ]
#13406: Patches to fix php count warnings with PHP 7.2
------------------------------+-------------------------------------
Reporter: daraden | Owner: Stuart Auchterlonie
Type: Patch - Bug Fix | Status: accepted
Priority: minor | Milestone: 30.1
Component: Plugin - MythWeb | Version: Master Head
Severity: low | Resolution:
Keywords: | Ticket locked: 0
------------------------------+-------------------------------------

Comment (by Richard Shaw <hobbes1069@…>):

In [changeset:"c04a650ee5a403a10a3944335a5ad2599a01391d/mythweb"
c04a650ee/mythweb]:
{{{
#!CommitTicketReference repository="mythweb"
revision="c04a650ee5a403a10a3944335a5ad2599a01391d"
Fix php7.2 count warnings in mythweb.

This only fixes the mythweb portion of this bug. The MythBackend.php
file still needs to be fixed in the mythtv repository.

Refs #13406.

Signed-off-by: David Hampton <mythtv@love2code.net>
}}}

--
Ticket URL: <https://code.mythtv.org/trac/ticket/13406#comment:7>
MythTV <http://www.mythtv.org>
MythTV Media Center
Re: Ticket #13406: Patches to fix php count warnings with PHP 7.2 [ In reply to ]
#13406: Patches to fix php count warnings with PHP 7.2
------------------------------+-------------------------------------
Reporter: daraden | Owner: Stuart Auchterlonie
Type: Patch - Bug Fix | Status: accepted
Priority: minor | Milestone: 30.1
Component: Plugin - MythWeb | Version: Master Head
Severity: low | Resolution:
Keywords: | Ticket locked: 0
------------------------------+-------------------------------------

Comment (by David Hampton <mythtv@…>):

In [changeset:"7e2e51d1d83587f1575ba1448531a1d303f0bfad/mythweb"
7e2e51d1d/mythweb]:
{{{
#!CommitTicketReference repository="mythweb"
revision="7e2e51d1d83587f1575ba1448531a1d303f0bfad"
Fix php7.2 count warnings in mythweb Schedule.php.

This only fixes the mythweb portion of this bug. The MythBackend.php
file still needs to be fixed in the mythtv repository.

Adapted from a fix by daraden.

Refs #13406.
}}}

--
Ticket URL: <https://code.mythtv.org/trac/ticket/13406#comment:8>
MythTV <http://www.mythtv.org>
MythTV Media Center
Re: Ticket #13406: Patches to fix php count warnings with PHP 7.2 [ In reply to ]
#13406: Patches to fix php count warnings with PHP 7.2
------------------------------+-------------------------------------
Reporter: daraden | Owner: Stuart Auchterlonie
Type: Patch - Bug Fix | Status: closed
Priority: minor | Milestone: 30.1
Component: Plugin - MythWeb | Version: Master Head
Severity: low | Resolution: fixed
Keywords: | Ticket locked: 0
------------------------------+-------------------------------------
Changes (by David Hampton <mythtv@…>):

* status: accepted => closed
* resolution: => fixed


Comment:

In [changeset:"dc87fada554f8b200bf8b67ce51174936b429a04/mythtv"
dc87fada5/mythtv]:
{{{
#!CommitTicketReference repository="mythtv"
revision="dc87fada554f8b200bf8b67ce51174936b429a04"
Fix php7.2 count warnings in MythBackend bindings.

The mythweb portion of this bug was fixed in a separate commit.

Adapted from a fix by daraden.

Fixes #13406.
}}}

--
Ticket URL: <https://code.mythtv.org/trac/ticket/13406#comment:9>
MythTV <http://www.mythtv.org>
MythTV Media Center