Skip to content

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

Merged
merged 2 commits into from
Dec 10, 2018

Conversation

gmachure
Copy link
Contributor

@gmachure gmachure commented Nov 16, 2018

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)

  1. Magento 2 : fix php 7.2 error : Countable interface not implemented #19247: fix php 7.2 error : Countable interface not implemented

Manual testing scenarios (*)

  1. Upload image in ui component form in a custom module
  2. Test :
    -Create custom module
    -Add a file uploader in ui component form.
    -Upload an image.
    -PHP version : 7.2.12

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@magento-engcom-team
Copy link
Contributor

Hi @gmachure. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me 2.3-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@gmachure
Copy link
Contributor Author

@magento-engcom-team give me test instance

@magento-engcom-team
Copy link
Contributor

Hi @gmachure. Thank you for your request. I'm working on Magento instance for you

@magento-engcom-team
Copy link
Contributor

Hi @gmachure, here is your new Magento instance.
Admin access: http://34.228.235.121/pr-19249//admin
Login: admin Password: 123123q

@orlangur orlangur self-assigned this Nov 16, 2018
@magento-engcom-team magento-engcom-team added this to the Release: 2.3.1 milestone Nov 17, 2018
@magento-engcom-team
Copy link
Contributor

Hi @orlangur, thank you for the review.
ENGCOM-3483 has been created to process this Pull Request

@magento-engcom-team
Copy link
Contributor

@gmachure thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository.

@magento-engcom-team
Copy link
Contributor

Hi @gmachure. Thank you for your contribution.
We will aim to release these changes as part of 2.3.1.
Please check the release notes for final confirmation.

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.

4 participants