? Success
Pull Request for # 12310

User tests: Successful: Unsuccessful:

avatar 810
810
4 Oct 2016

Steps to reproduce the issue

PHP 7.1 RC3
Joomla 3..6.x

Expected result

No notice message on joomla update page

Actual result

Notice: A non well formed numeric value encountered in C:\wamp\www\develop\administrator\components\com_installer\models\warnings.php on line 45

System information (as much as possible)

Additional comments

avatar 810 810 - open - 4 Oct 2016
avatar 810 810 - change - 4 Oct 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 4 Oct 2016
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 4 Oct 2016
Category Administration Components
avatar zero-24
zero-24 - comment - 4 Oct 2016

Please post your memory limit value.

avatar 810
810 - comment - 4 Oct 2016

memory_limit 256M

avatar 810
810 - comment - 4 Oct 2016

i see also Low PHP memory limit. warning on the warning page.

But on the information page i see the correct values

Ok after remove th efix, the messages are gone, so the fix need to be fixed elsewhere

avatar 810
810 - comment - 4 Oct 2016

Ok, it should now work

avatar mbabker mbabker - change - 5 Oct 2016
Rel_Number 0 12310
Relation Type Pull Request for
avatar PhilETaylor
PhilETaylor - comment - 22 Oct 2016

I have this issue on a brand new iMac with PHP 7.1RC installed from brew

System info
https://gist.github.com/PhilETaylor/3be36d59cd676fe36eda4f5520cae7a8

avatar PhilETaylor PhilETaylor - test_item - 22 Oct 2016 - Tested successfully
avatar PhilETaylor
PhilETaylor - comment - 22 Oct 2016

I have tested this item successfully on 5367269

After applying path the warnings are removed.


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

avatar zero-24
zero-24 - comment - 22 Oct 2016

After applying path the warnings are removed.

Just to be sure. I gues path is just a typo and should be patch?

avatar PhilETaylor
PhilETaylor - comment - 22 Oct 2016

yeah - should be after applying the patch, the warnings were removed :)

avatar PhilETaylor
PhilETaylor - comment - 5 Nov 2016

Still an issue in PHP 7.1.0RC5

avatar 810
810 - comment - 5 Nov 2016

if someone else can test and approve, then we have a rtc

avatar PhilETaylor
PhilETaylor - comment - 5 Nov 2016

@mbabker do you have PHP 7.1 installed locally ? can you test this?

avatar 810
810 - comment - 18 Nov 2016

any testers?

avatar 810
810 - comment - 2 Dec 2016

Can we merge this one, now 7.1 is released.

avatar brianteeman
brianteeman - comment - 2 Dec 2016

@810 only if it is tested

avatar PhilETaylor
PhilETaylor - comment - 3 Dec 2016

I tested it :) and again today, still works ;-)

I dunno who else uses PHP 7.1 in production, it seems we are a rare breed of people ;-)

avatar ralain
ralain - comment - 5 Dec 2016

I have tested this item successfully on 5367269

Ran into the same issue. This fixes it. Thanks!


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

avatar ralain ralain - test_item - 5 Dec 2016 - Tested successfully
avatar zero-24 zero-24 - change - 5 Dec 2016
The description was changed
Milestone Added:
Status Pending Ready to Commit
Labels Added: ?
avatar zero-24 zero-24 - change - 5 Dec 2016
Labels Removed: ? ?
avatar zero-24 zero-24 - edited - 5 Dec 2016
avatar zero-24 zero-24 - change - 5 Dec 2016
Milestone Added:
avatar joomla-cms-bot joomla-cms-bot - change - 5 Dec 2016
Category Administration Components Administration com_installer Components
avatar rdeutz rdeutz - change - 6 Dec 2016
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2016-12-06 21:51:22
Closed_By rdeutz
Labels Added: ? ?
avatar rdeutz rdeutz - close - 6 Dec 2016
avatar rdeutz rdeutz - merge - 6 Dec 2016
avatar rdeutz rdeutz - reference | ec9a78a - 6 Dec 16
avatar rdeutz rdeutz - merge - 6 Dec 2016
avatar rdeutz rdeutz - close - 6 Dec 2016
avatar tkuschel
tkuschel - comment - 22 Jan 2017

I just reviewed the function, because i ran into the same issue with php 7.1 installed on an arch.
My comment:
The public function return_bytes($val) not only fixes the above issue, but the function was extended with new functionality and more costs.
It is a copy of http://php.net/manual/en/function.ini-get.php#106518 ! I'm not sure, whether this user example on php.net is the best for Joomla core.
a) Who needs the "gb" "kb" "mb" ? - Never tested.
b) What's about sending " "? - First, it jumps over the line if(empty($val))return 0;.
c) Expensive regular expression, aso.
But who cares? - the function is fixed.
Wouldn't it be nice to support also 1.4M or 3.72k ?

avatar photodude
photodude - comment - 16 Mar 2017

Just set up a system with PHP 7.1 for a blog post, glad to see that there is a fix for this issue.
seen when accessing administrator/index.php?option=com_joomlaupdate

Notice: A non well formed numeric value encountered in \administrator\components\com_installer\models\warnings.php on line 45

Notice: A non well formed numeric value encountered in \administrator\components\com_installer\models\warnings.php on line 45

Notice: A non well formed numeric value encountered in \administrator\components\com_installer\models\warnings.php on line 45

Information about the system

Setting Value
PHP Built On (Windows 7 Professional Edition Service Pack 1) AMD64
Database Version 5.7.17
Database Collation utf8_general_ci
Database Connection Collation utf8mb4_general_ci
PHP Version 7.1.2
Web Server Apache/2.4.20 (Win64) OpenSSL/1.0.2g PHP/7.1.2
WebServer to PHP Interface apache2handler
Joomla! Version Joomla! 3.6.5 Stable [ Noether ] 1-December-2016 22:46 GMT
Joomla! Platform Version Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
User Agent Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36

another way to fix this that is a little more compact is to add this line between $last and the switch case

$val = preg_replace('~\D~', '', $val);

as follows

	public function return_bytes($val)
	{
		$val = trim($val);
		$last = strtolower($val{strlen($val) - 1});
		$val = preg_replace('~\D~', '', $val);

		switch ($last)
		{
			// The 'G' modifier is available since PHP 5.1.0
			case 'g':
				$val *= 1024;
			case 'm':
				$val *= 1024;
			case 'k':
				$val *= 1024;
		}

		return (int) $val;
	}
avatar PhilETaylor
PhilETaylor - comment - 16 Mar 2017

This is already fixed for the next release

avatar photodude
photodude - comment - 16 Mar 2017

Yes, glad to see that there is a fix for this issue.

avatar ittoufiq
ittoufiq - comment - 30 Mar 2017

Hi, I want to know that, exactly which version fixed this issue. Thanks


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

avatar zero-24
zero-24 - comment - 30 Mar 2017

@ittoufiq 3.7.0

Add a Comment

Login with GitHub to post a comment