fix php 7.2 error : Countable interface not implemented#19249
fix php 7.2 error : Countable interface not implemented#19249magento-engcom-team merged 2 commits intomagento:2.3-developfrom
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 (*)