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

PHP Notice: A non well formed numeric value encountered in .../Inputfield/InputfieldFile/InputfieldFile.module:124 #2022

Closed
adrianbj opened this issue Sep 6, 2016 · 3 comments
Labels

Comments

@adrianbj
Copy link

adrianbj commented Sep 6, 2016

I just set up a php 7 testing environment and noticed this. It is because $filesize returns "8M" so on line 124 you have this:

else if($last == 'm') $this->maxFilesize = ($filesize*1024)*1024;

which obviously won't work as expected.
screen shot 2016-09-05 at 6 30 41 pm

Note that the line numbers have changed by one because I inserted the Tracy bd() call to find out what $filesize was returning.

@adrianbj
Copy link
Author

adrianbj commented Sep 6, 2016

As a bit of an aside - should the init() be called twice like it is? I am noticing that all over the place, but maybe that is expected.

Nevermind - there were two image fields on the page :)

@ryancramerdesign
Copy link
Owner

Thanks Adrian, I've pushed a fix for this. I have a feeling there will be more of those notices as I've never been shy about using PHP's auto int casting via math operators, but apparently they throw notices for that now.

@adrianbj
Copy link
Author

adrianbj commented Sep 6, 2016

Thanks Ryan - I never actually knew that PHP auto casted via math operators - learn something new every day, although apparently I should forget this pretty quickly :)

@adrianbj adrianbj closed this as completed Sep 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants