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

[Magento 2.3.2] Upload fails in image uploader #24332

Closed
posttechguy opened this issue Aug 28, 2019 · 17 comments · Fixed by #29671
Closed

[Magento 2.3.2] Upload fails in image uploader #24332

posttechguy opened this issue Aug 28, 2019 · 17 comments · Fixed by #29671
Labels
Component: Framework/Wysiwyg Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Priority: P3 May be fixed according to the position in the backlog. Progress: done Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround.

Comments

@posttechguy
Copy link

posttechguy commented Aug 28, 2019

Preconditions:
Magento 2.4-develop
Php 7.3
fileinfo php extension is disabled

Steps to reproduce:

  1. Go to Admin -> Content -> Pages;
  2. Open "Home Page" to edit (for ex.);
  3. Expand the Content tab;
  4. Select the image uploader ("Insert Image" button or the one in the editor);
  5. Select an image from your HD and upload it.

Actual Result: ✖️ Error: Call to undefined function mime_content_type()

✖️ An error is shown: "File validation failed." No image is uploaded.

Screenshot from 2020-09-08 10-59-21

Expected Result: ✔️ An image must be uploaded without errors

Screenshot from 2020-09-18 15-54-24

The temp uploaded file, i.e., '/tmp/sdfds5we23e', which has no extension, is trying to get the extension thus failing to verify against the validTypes array

@m2-assistant
Copy link

m2-assistant bot commented Aug 28, 2019

Hi @posttechguy. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.3-develop instance - upcoming 2.3.x release

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

@posttechguy do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Aug 28, 2019
@engcom-Charlie engcom-Charlie self-assigned this Aug 28, 2019
@m2-assistant
Copy link

m2-assistant bot commented Aug 28, 2019

Hi @engcom-Charlie. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Charlie
Copy link
Contributor

Hello @posttechguy thank you for your report! I'm not able to reproduce issue on clean Magento 2.3.2 .

Manual testing scenario:

  1. Go to Content -> Pages -> Edit Home page
  2. Add img to Content of CMS Page
    image

Actual result:
Image uploaded without any errors
image

So i have to close this issue. If you have more info please update your issue.

@posttechguy
Copy link
Author

posttechguy commented Aug 29, 2019

Hi @engcom-Charlie I can confirm that the file upload does not work on 2.3-develop. The reason is that the mime_content_type is removed in 7.1, and while it is checked to see if it exists the getFileExtension is not retrieving the ext because when the file is uploaded to /tmp directory, it saves it without an extension. So there is now way to ascertain whether the file is valid or not.

I have tried it on PHP 7.2.16 also
Screen Shot 2019-08-29 at 9 57 44 am

Bevan

@posttechguy
Copy link
Author

I have also found this bug, on PHP 7.2.16

Fatal error: Uncaught Error: Call to undefined function mime_content_type() in /vagrant/httpdocs/m23-dev/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php:362 Stack trace: #0 /vagrant/httpdocs/m23-dev/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Content/Files.php(60): Magento\Cms\Model\Wysiwyg\Images\Storage->getFilesCollection('/vagrant/httpdo...', 'image') #1 /vagrant/httpdocs/m23-dev/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Content/Files.php(74): Magento\Cms\Block\Adminhtml\Wysiwyg\Images\Content\Files->getFiles() #2 /vagrant/httpdocs/m23-dev/app/code/Magento/Cms/view/adminhtml/templates/browser/content/files.phtml(13): Magento\Cms\Block\Adminhtml\Wysiwyg\Images\Content\Files->getFilesCount() #3 /vagrant/httpdocs/m23-dev/lib/internal/Magento/Framework/View/TemplateEngine/Php.php(59): include('/vagrant/httpdo...') #4 /vagrant/httpdocs/m23-dev/lib/internal/Magento/Framework/View/Element/Template.php(270): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\Cms\Block\Adminhtml\Wysiwyg\Im in /vagrant/httpdocs/m23-dev/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php on line 362

Again calling the removed function mime_content_type

@engcom-Charlie
Copy link
Contributor

@posttechguy sorry but in my Magento 2.3.2 instance all works fine:
image

@hostep
Copy link
Contributor

hostep commented Sep 1, 2019

This is a duplicate of #16531 (comment)

@posttechguy: installing the fileinfo php extension should solve your issue.

In my opinion the fileinfo extension needs to get added to the requirements in the composer.json file of Magento's Framework and the composer.json file of the CMS module

Interested in creating a pull request for this?

@posttechguy
Copy link
Author

Thanks @hostep, that was my issue.

I have added a PR for the issue

Cheers

@AndyJAllen
Copy link

AndyJAllen commented Sep 12, 2019

Adding the fileinfo extension fixed my issue too. This should be added to the requirements page:
https://devdocs.magento.com/guides/v2.3/install-gde/system-requirements-tech.html

@ghost ghost assigned posttechguy and unassigned engcom-Charlie Oct 15, 2019
@engcom-Charlie engcom-Charlie self-assigned this Oct 15, 2019
@engcom-Charlie engcom-Charlie added Component: Framework/Wysiwyg Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Oct 15, 2019
@ghost ghost unassigned engcom-Charlie Oct 15, 2019
@magento-engcom-team magento-engcom-team added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Oct 15, 2019
@magento-engcom-team
Copy link
Contributor

✅ Confirmed by @engcom-Charlie
Thank you for verifying the issue. Based on the provided information internal tickets MC-21825 were created

Issue Available: @engcom-Charlie, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@ghost ghost unassigned posttechguy Oct 30, 2019
@krisdante
Copy link
Contributor

@magento give me 2.3-develop instance

@magento-engcom-team
Copy link
Contributor

Hi @krisdante. Thank you for your request. I'm working on Magento 2.3-develop instance for you

@magento-engcom-team
Copy link
Contributor

Hi @krisdante, here is your Magento instance.
Admin access: https://i-24332-2-3-develop.instances.magento-community.engineering/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

@magento-engcom-team magento-engcom-team added this to Ready for Dev in Community Backlog Mar 24, 2020
@sidolov sidolov added this to Ready for Grooming in Low Priority Backlog Sep 3, 2020
@m2-community-project m2-community-project bot moved this from Ready for Grooming to Pull Request In Progress in Low Priority Backlog Sep 3, 2020
@m2-community-project m2-community-project bot added Progress: PR Created Indicates that Pull Request has been created to fix issue and removed Progress: PR in progress labels Sep 3, 2020
@magento-engcom-team magento-engcom-team added Progress: ready for dev and removed Progress: PR Created Indicates that Pull Request has been created to fix issue labels Sep 18, 2020
@ghost ghost moved this from PR In Progress to Ready for Dev in Community Backlog Sep 18, 2020
@engcom-Alfa engcom-Alfa added Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch and removed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Sep 18, 2020
@ghost ghost moved this from Ready for Dev to Ready for QA in Community Backlog Sep 18, 2020
@magento-engcom-team magento-engcom-team added Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed and removed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed labels Sep 18, 2020
@engcom-Alfa engcom-Alfa added the Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed label Sep 18, 2020
@ghost ghost moved this from Ready for QA to Ready for Dev in Community Backlog Sep 18, 2020
@magento-engcom-team
Copy link
Contributor

✅ Confirmed by @engcom-Alfa
Thank you for verifying the issue. Based on the provided information internal tickets MC-37754 were created

Issue Available: @engcom-Alfa, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@magento-engcom-team magento-engcom-team added Fixed in 2.4.x The issue has been fixed in 2.4-develop branch and removed Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Sep 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Framework/Wysiwyg Fixed in 2.4.x The issue has been fixed in 2.4-develop branch Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Priority: P3 May be fixed according to the position in the backlog. Progress: done Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround.
Projects
No open projects
Community Backlog
  
Done (last 30 days)
Development

Successfully merging a pull request may close this issue.

9 participants