Skip to content
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

Closed
wants to merge 7 commits into from
Closed

CRM-21591 A non well formed numeric value encountered #11429

wants to merge 7 commits into from

Conversation

Jazz-Man
Copy link
Contributor

@Jazz-Man Jazz-Man commented Dec 18, 2017

PHP Notice: A non well formed numeric value encountered

WordPress Admin Area:
ostfyn dev_wp-admin_admin php_page civicrm q civicrm 2525252fadmin 2525252fsetting 2525252fmisc reset 1 laptop with hidpi screen


PHP Notice: A non well formed numeric value encountered
@@ -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;
Copy link
Contributor

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;

Copy link
Contributor Author

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

@@ -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;
Copy link
Contributor

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

@seamuslee001
Copy link
Contributor

seamuslee001 commented Dec 18, 2017

@Jazz-Man can i confirm your seeing this on php7.1? ping @eileenmcnaughton @totten

@Jazz-Man
Copy link
Contributor Author

Yes, I use php7.1 in a local development environment

@@ -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;

Copy link
Contributor

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?

Copy link
Contributor Author

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

@@ -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;
Copy link
Contributor

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

Copy link
Contributor Author

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.

@seamuslee001
Copy link
Contributor

@Jazz-Man Thanks for this i have verified it does fix the issue. I was able to replicate the problem in a unit test so added one here #11447 are you able to do a git rebase and squash these commits into 1?

@seamuslee001
Copy link
Contributor

Jenkins re test this please

@eileenmcnaughton eileenmcnaughton changed the title A non well formed numeric value encountered CRM-21591 A non well formed numeric value encountered Jan 10, 2018
@eileenmcnaughton
Copy link
Contributor

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

@eileenmcnaughton
Copy link
Contributor

closing as replaced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants