-
-
Notifications
You must be signed in to change notification settings - Fork 826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CRM-21591 A non well formed numeric value encountered #11429
Conversation
PHP Notice: A non well formed numeric value encountered
CRM/Utils/Number.php
Outdated
@@ -88,30 +88,32 @@ public static function createTruncatedDecimal($keyValue, $precision) { | |||
public static function formatUnitSize($size, $checkForPostMax = FALSE) { | |||
if ($size) { | |||
$last = strtolower($size{strlen($size) - 1}); | |||
$_size = (int)$size; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Jazz-Man i think you can do $size = (float) $size;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I'll try to fix it
CRM/Utils/Number.php
Outdated
@@ -88,30 +88,32 @@ public static function createTruncatedDecimal($keyValue, $precision) { | |||
public static function formatUnitSize($size, $checkForPostMax = FALSE) { | |||
if ($size) { | |||
$last = strtolower($size{strlen($size) - 1}); | |||
$_size = (int)$size; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you could keep the name $size & make this a one-liner patch
@Jazz-Man can i confirm your seeing this on php7.1? ping @eileenmcnaughton @totten |
Yes, I use php7.1 in a local development environment |
CRM/Utils/Number.php
Outdated
@@ -88,6 +88,8 @@ public static function createTruncatedDecimal($keyValue, $precision) { | |||
public static function formatUnitSize($size, $checkForPostMax = FALSE) { | |||
if ($size) { | |||
$last = strtolower($size{strlen($size) - 1}); | |||
$size = (int) $size; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Jazz-Man there appears to be whitespace on this line that is causing issues with out test bot. Are you able to fix it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I'll try right now
CRM/Utils/Number.php
Outdated
@@ -88,6 +88,7 @@ public static function createTruncatedDecimal($keyValue, $precision) { | |||
public static function formatUnitSize($size, $checkForPostMax = FALSE) { | |||
if ($size) { | |||
$last = strtolower($size{strlen($size) - 1}); | |||
$size = (int)$size; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Jazz-Man you need to have 1 space between the (int) and $size
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's all through github's online editor.
Now everything is fine, testing goes on.
Jenkins re test this please |
I've given this merge on pass - @seamuslee001 explains the merged test would have failed on php 7.1 but always passed on lower versions. (not visible in our CI since we do lower versions). Merge on pass based on Seamus review & test |
closing as replaced |
PHP Notice: A non well formed numeric value encountered
WordPress Admin Area:
