Opened 6 years ago
Closed 6 years ago
Last modified 6 years ago
#13260 closed Patch - Bug Fix (Fixed)
Mythweb throws php warning on 'recorded programmes' screen under php7.2
Reported by: | Owned by: | Stuart Auchterlonie | |
---|---|---|---|
Priority: | minor | Milestone: | 29.2 |
Component: | Plugin - MythWeb | Version: | v29-fixes |
Severity: | low | Keywords: | |
Cc: | Ticket locked: | no |
Description
MythTV version 29-fixes on lubuntu 18.04 (php version 7.2)
The 'recorded programmes' screen of mythweb reports two php warnings at the top of the screen. All of the content below displays correctly.
The text of the errors is:
Warning at /usr/share/mythtv/mythweb/modules/tv/recorded.php, line 188: !!NoTrans: Use of undefined constant disk_size - assumed 'disk_size' (this will throw an Error in a future version of PHP)!! Warning at /usr/share/mythtv/mythweb/modules/tv/recorded.php, line 189: !!NoTrans: Use of undefined constant disk_used - assumed 'disk_used' (this will throw an Error in a future version of PHP)!!
The fix is to add single quotes around the terms 'disk_size' and 'disk used'
george@tvbox:/usr/share/mythtv/mythweb/modules/tv$ diff recorded.php recorded.php~ 188,189c188,189 < define(disk_size, ($size * 1024)); < define(disk_used, ($used * 1024)); --- > define('disk_size', ($size * 1024)); > define('disk_used', ($used * 1024));
I have only seen this on the latest [l]ubuntu release with php7.2. Earlier releases are fine.
george@tvbox:~$ php --version PHP 7.2.3-1ubuntu1 (cli) (built: Mar 14 2018 22:03:58) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.3-1ubuntu1, Copyright (c) 1999-2018, by Zend Technologies
Change History (4)
comment:1 Changed 6 years ago by
comment:2 Changed 6 years ago by
I can confirm that Gary's patch does remove the warning under php 7.3.
comment:3 Changed 6 years ago by
Resolution: | → Fixed |
---|---|
Status: | new → closed |
master:664dc1707ccf7be8b0b1d9eadf6366de8bbaa9c9/mythweb
v29/fixes: 6a6eb1a4a9e48a3f7fcf3006cb4404051e572911/mythweb
Same fix as above, I just didn't look for the ticket 1st.
comment:4 Changed 6 years ago by
Milestone: | needs_triage → 29.2 |
---|
FWIW, there is also a define of those variables a few lines previously which would be invoked if one has php-gmp available.
So I believe (untested) the more complete fix would be: