-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Fix Issue #19872 - checking if image is in media directory #21131
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
Fix Issue #19872 - checking if image is in media directory #21131
Conversation
Hi @Bartlomiejsz. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
@magento-engcom-team give me 2.3-develop instance |
Hi @Bartlomiejsz. Thank you for your request. I'm working on Magento 2.3-develop instance for you |
Hi @Bartlomiejsz, here is your Magento instance. |
@magento-engcom-team give me test instance |
Hi @Bartlomiejsz. Thank you for your request. I'm working on Magento instance for you |
Hi @Bartlomiejsz, here is your new Magento instance. |
@magento-engcom-team give me test instance |
Hi @dmytro-ch. Thank you for your request. I'm working on Magento instance for you |
Hi @dmytro-ch, here is your new Magento instance. |
Hi @Bartlomiejsz, Could you please make sure the issue is not related to your local envronment configuration? Thank you! |
@dmytro-ch that's right, I also noticed, that the issue doesn't appear on github-generated instance of Magento. But I think this is related to location of Magento instance. If it is located in root directory (which is not recommended due to security, but I think still this is used by github-generated instance) the issue doesn't occur. But if Magento is installed in recommended pub/ directory, the issue occurs. |
@Bartlomiejsz I was also thinking about that and tested the issue locally in However, after switching to PHP 7.2 the issue is not reproducible anymore. Thank you! |
@dmytro-ch I'm currently running on 7.1.25, but I had same issue on instance running on 7.2.14 |
@magento-engcom-team give me test instance |
Hi @Bartlomiejsz. Thank you for your request. I'm working on Magento instance for you |
@magento-engcom-team give me test instance |
Hi @Bartlomiejsz. Thank you for your request. I'm working on Magento instance for you |
Hi @Bartlomiejsz, here is your new Magento instance. |
@dmytro-ch could you please recheck this one? Current solution should work no matter if installation is in root or pub directory |
…o feature/fix_19872_category_image_path
Hi @Bartlomiejsz. Thank you for your request. I'm working on Magento 2.3-develop instance for you |
Hi @Bartlomiejsz, here is your Magento instance. |
Hi @sivaschenko. I think I understand you're point, but there is one problem I think. Sorry, I haven't thought about this before. Changing way of storing those paths is feature rather than fix in my opinion - I don't think this is the reason of any issue currently. |
Hi @Bartlomiejsz , thanks for your response. Would you be able to add tests cases to |
Hi @sivaschenko, will work on it! |
Hi @sivaschenko, added tests. Especially important here are paths beginning with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the tests @Bartlomiejsz
The only thing that is not covered by the fix is the custom pub
directory path.
Please use $this->filesystem->getDirectoryRead(DirectoryList::PUB)->getRelativePath()
to retrive the correct pub directory path
Hi @sivaschenko, done |
Hi @sivaschenko, thank you for the review. |
✔️ QA Passed |
…19872_category_image_path
Hi @Bartlomiejsz, thank you for your contribution! |
Now when the selected image is saved (and is still there in backend), is it showing on frontend? |
I have that same problem. |
Description (*)
Issue #19872 (closed) is still not fixed on develop branch.
On develop when image is added from media gallery while configuring category, it's path is saved as /media/path_to_file, but while Magento tries to check if this image is placed in media it compares it's path with pub/media/ instead of media/.
Fixed Issues (if relevant)
Manual testing scenarios (*)
Contribution checklist (*)