-
Notifications
You must be signed in to change notification settings - Fork 9.4k
fix php 7.2 error : Countable interface not implemented #19249
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
Conversation
Hi @gmachure. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
@magento-engcom-team give me test instance |
Hi @gmachure. Thank you for your request. I'm working on Magento instance for you |
Hi @gmachure, here is your new Magento instance. |
Hi @orlangur, thank you for the review. |
Hi @gmachure. Thank you for your contribution. |
Description (*)
We created a custom module with ui component form with a file upload field. While the upload, the method _setUploadFileId from vendor/magento/framework/File/Uploader.php generate a warning because Countable interface is not implement for a string (PHP version : 7.2.12).
$file[0] is a string and not an array. So count($file[0]) generate an error.
Fixed Issues (if relevant)
Manual testing scenarios (*)
-Create custom module
-Add a file uploader in ui component form.
-Upload an image.
-PHP version : 7.2.12
Contribution checklist (*)