?
avatar rotech1
rotech1
15 Feb 2018

Hmm... 3.8.6 puts this back in...

Steps to reproduce the issue

Visit various assorted pages on Joomla 3.8.5 site

Expected result

No warnings in PHP error log

Actual result

Numerous warnings in PHP error log, example
[Sun Feb 04 01:01:43 2018] [warn] [client xxx.xxx.xxx.xxx] PHP Warning: A non-numeric value encountered in /[redacted]/html/libraries/legacy/request/request.php on line 518
[Sun Feb 04 01:01:43 2018] [warn] [client xxx.xxx.xxx.xxx] PHP Warning: A non-numeric value encountered in /[redacted]/html/libraries/legacy/request/request.php on line 524
[Sun Feb 04 01:01:43 2018] [warn] [client xxx.xxx.xxx.xxx] PHP Warning: A non-numeric value encountered in /[redacted]/html/libraries/legacy/request/request.php on line 528

System information (as much as possible)

Joomla 3.8.5 on Apache
PHP version 7.1.13

Additional comments

Apparently it's a new check in PHP7.1

( see https://stackoverflow.com/questions/42044127/warning-a-non-numeric-value-encountered )

Looking at the last function in request.php it seems some pages feed the function a non-numeric (but not empty!) $mask

My workaround is to add this line at the top of the function:

if (! is_numeric($mask)){$mask=0;}

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
3.00

avatar rotech1 rotech1 - open - 15 Feb 2018
avatar joomla-cms-bot joomla-cms-bot - labeled - 15 Feb 2018
avatar brianteeman
brianteeman - comment - 15 Feb 2018

These are deprecated classes not used in the core. Shouldn't we just be encouraging people to use the replacements as documented in that files doc blocks?

avatar mbabker
mbabker - comment - 15 Feb 2018

Yes, but, deprecated code should continue to function without error until removed.

avatar franz-wohlkoenig franz-wohlkoenig - change - 15 Feb 2018
Status New Discussion
avatar alikon
alikon - comment - 16 Feb 2018

@rotech1 please test #19710
can you tell us how do you reproduce this issue ? an extension, template etc?
i'm unable to replicate

avatar rotech1
rotech1 - comment - 16 Feb 2018

The warning is triggered by numerous things... I have seen it referred by the index page, even. It's been triggered by the Joomla Wrapper | iframe wrapper. Kunena forums( latest version!). Lets see, also some facebook plugin, MultiSocialTabs, Jomclassifieds , Gtrans module... CB developer (joomlapolis) acknowledges five places [ see https://www.joomlapolis.com/forum/255-developer-members-support/238573-heads-up-cb-still-using-some-deprecated-classes-php7-1-warnings#302116 ] where their code currently calls it (and they are working on that).

Anyway, it's very widespread.
Can you please point me to the docs where that (and other) deprecations have a timeline for "extinction"?

I expect I might have some extensive hacking to do in the not too distant future, since by necessity we're already using lots of 'legacy' code that's been customized. Is it really in the best interests of the community to do away with the legacy library altogether?

( I pulled the examples above out of recent error log archives, I don't see the PHP warning anymore now that I have hacked the request.php page as described above...)

avatar mbabker
mbabker - comment - 16 Feb 2018

https://api.joomla.org/cms-3/deprecated.html lists all deprecated elements in the 3.x code tree, and for the most part the first version they MAY be removed at (i.e. next major, 4.0).

Some stuff still has the old Platform version numbering, maybe one day we can get that all back on CMS versioning. But for those cases assume it means 4.0.

Some stuff has the version in which the deprecation was introduced; if it has a 3.x(non-zero) number assume it means 4.0.

FWIW JRequest has been deprecated since 2011. https://groups.google.com/forum/#!msg/joomla-dev-framework/LbALkK1ifMo/5waSiIlb21gJ has some additional context.

avatar rotech1
rotech1 - comment - 16 Feb 2018

@alikon - tested #19710 locally, works perfectly for me. (Confirmed: no warnings thrown in any of my known cases.)

avatar rotech1
rotech1 - comment - 16 Feb 2018

@mbabker Thanks very much!

avatar alikon
alikon - comment - 16 Feb 2018

please mark succesfully tested on the pr

avatar brianteeman
brianteeman - comment - 16 Feb 2018

closed please test #19710

avatar brianteeman brianteeman - change - 16 Feb 2018
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2018-02-16 21:08:36
Closed_By brianteeman
avatar brianteeman brianteeman - close - 16 Feb 2018
avatar rotech1 rotech1 - change - 20 Mar 2018
The description was changed
Title
libraries/legacy/request/request.php throws lots of PHP7.1 warnings
libraries/legacy/request/request.php throws lots of PHP7.1 warnings - regressed in 3.8.6
avatar rotech1 rotech1 - edited - 20 Mar 2018
avatar rotech1 rotech1 - edited - 20 Mar 2018
avatar rotech1
rotech1 - comment - 20 Mar 2018

how to re-open this?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19695.

avatar mbabker
mbabker - comment - 20 Mar 2018

No need. The pull request which fixes this is still open.

Add a Comment

Login with GitHub to post a comment