Information Required ? ? ? Failure

User tests: Successful: Unsuccessful:

avatar jigius
jigius
1 Jun 2020

Summary of Changes

Since PHP 7.{1-4} server's logs are polluted with notice messages PHP Notice: A non well formed numeric value encountered in %ROOT%/libraries/src/Profiler/Profiler.php on line 126.

The problem is wrong type casting (from string to float).

This patch is resolving this.

Testing Instructions

Looking for mentioned notices into server's logs after any pages have being requested via http proto.

Attention: notice level of messages has to been allowed!

Expected result

Mentioned notices is not found.

Actual result

Mentioned notices is found.

Documentation Changes Required

None

avatar jigius jigius - open - 1 Jun 2020
avatar jigius jigius - change - 1 Jun 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 1 Jun 2020
Category Libraries
avatar bonzani bonzani - test_item - 1 Jun 2020 - Tested successfully
avatar bonzani
bonzani - comment - 1 Jun 2020

I have tested this item successfully on 4f1d9f5


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

avatar HLeithner
HLeithner - comment - 10 Jul 2020

I moved this to the next version and have an annotation.

With the new code we loose "+" sign for time and memory on output. I would suggest to precompile this values before adding this to the object and in the printf function.

Or evaluate why and if we need this * / 1000 manipulation.

avatar SharkyKZ
SharkyKZ - comment - 4 Sep 2020

I would suggest to precompile this values before adding this to the object and in the printf function.

Are you suggesting to change values stored in Joomla\Profiler\Profiler::$marks? I'm hesitant to do this against staging in case anyone actually uses these values as string. On the other hand, this could avoid some problems in existing code when upgrading to PHP 8 (e.g. like we currently have in Debug plugin). In any case we should totally do this at least in 4.0.

I can make the PR, just need to know for which branch.

avatar SharkyKZ
SharkyKZ - comment - 4 Sep 2020

Anyways, this PR is fine for now.

avatar SharkyKZ SharkyKZ - test_item - 4 Sep 2020 - Tested successfully
avatar SharkyKZ
SharkyKZ - comment - 4 Sep 2020

I have tested this item successfully on 4f1d9f5


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

avatar SharkyKZ SharkyKZ - change - 4 Sep 2020
Status Pending Ready to Commit
Labels Added: ?
avatar SharkyKZ
SharkyKZ - comment - 4 Sep 2020

RTC.


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

avatar SharkyKZ
SharkyKZ - comment - 4 Sep 2020

Actually we could fix this here properly, also without changing data type. @jigius are you still around?

avatar HLeithner
HLeithner - comment - 19 Sep 2020

@SharkyKZ I mean the text in the $buffer before this PR we had a + (plus) sign if the value is positive, after this change it's missing. but this doesn't touch the $marks array

avatar SharkyKZ
SharkyKZ - comment - 19 Sep 2020

This doesn't change buffer output because it's formatted below with sprintf() without plus sign anyways.

Anyways you might want to take a look at #30582 which solves this in a different way, also solving errors on PHP 8.

avatar HLeithner HLeithner - change - 14 Nov 2020
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-11-14 15:05:39
Closed_By HLeithner
avatar HLeithner HLeithner - close - 14 Nov 2020
avatar HLeithner HLeithner - merge - 14 Nov 2020
avatar HLeithner
HLeithner - comment - 14 Nov 2020

Thanks

Add a Comment

Login with GitHub to post a comment