Skip to content

Custom option image upload fails check-out with PayPal #6384

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

Closed
ddznelad opened this issue Aug 29, 2016 · 6 comments
Closed

Custom option image upload fails check-out with PayPal #6384

ddznelad opened this issue Aug 29, 2016 · 6 comments
Labels
bug report Component: Catalog Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch 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

Comments

@ddznelad
Copy link

Getting exception: Call to a member function isFile() on null in .../vendor/magento/module-catalog/Model/Product/Option/Type/File.php on line 452. If use payment methods other than PayPal it does not fail - copyQuoteToOrder function is used when use PayPal. In this function _rootDirectory variable never initialized anywhere and is therefore null. If I modify code and initialize the variable correctly using
$filesystem->getDirectoryWrite(DirectoryList::MEDIA) it fixes the issue partially - the order will be created and link is generated like site.com/sales/download/downloadCustomOption/id/19/key/e45e0dc5bb08417063e6/?SID=xxxxxxxxxxx, but if I click the link "page not found" pops-up

Preconditions

  1. Magento v2.1 CE
  2. PHP 7.0

Steps to reproduce

  1. Set up PayPal Express
  2. Create product with image upload custom option
  3. in front-end upload image and proceed to checkout using PayPal

Expected result

  1. Order should be created
  2. In order there should be link of the image.
  3. If you click the link to image the image should be downloaded

Actual result

  1. Server returns 500 error. PHP error log contains: PHP Fatal error: Call to a member function isFile() on null in .../vendor/magento/module-catalog/Model/Product/Option/Type/File.php on line 452
@ddznelad
Copy link
Author

If I apply my fix and click the image link at order info page, the option data will not be found in Magento\Sales\Controller\Download controller "DownloadCustomOption" function;

@ddznelad
Copy link
Author

ddznelad commented Sep 1, 2016

I found that my fix work for simple product, but for configurable product the issue remains.
In case of configurable product everything is fine until I hit "Place Order" button after PayPal procedure: I get "can't place an order' error (caused by exception in magento/module-catalog/Model/Product.php ) . See attached log.
system_log.txt

@alena-marchenko alena-marchenko self-assigned this Sep 21, 2016
@alena-marchenko
Copy link

Hi @ddznelad

We've created MAGETWO-58851 internal ticket regarding this issue.
Thank you!

@alena-marchenko alena-marchenko added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Sep 22, 2016
@alena-marchenko alena-marchenko removed their assignment Sep 27, 2016
@samrevs
Copy link

samrevs commented Jan 30, 2017

Does anyone have an update/fix for this issue?

@kandarp26
Copy link
Member

kandarp26 commented Jul 19, 2017

Added have same issue

Solution : vendor\magento\module-catalog\Model\Product\Option\Type\File.php line no 451

Before

if (!$this->_rootDirectory->isFile($quotePath) || !$this->_rootDirectory->isReadable($quotePath))

add below 2 lines

$filesystem = $this->_objectManager->get('Magento\Framework\Filesystem');
$this->_rootDirectory = $filesystem->getDirectoryRead(DirectoryList::ROOT);

@magento-engcom-team magento-engcom-team added 2.1.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development bug report Component: Catalog Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed labels Sep 11, 2017
@magento-engcom-team
Copy link
Contributor

@ddznelad, thank you for your report.
We were not able to reproduce this issue by following the steps you provided. If you'd like to update it, please reopen the issue.
We tested the issue on 2.3.0-dev, 2.2.0, 2.1.9

@magento-engcom-team magento-engcom-team added the Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch label Oct 11, 2017
magento-engcom-team pushed a commit that referenced this issue Dec 6, 2020
[Arrows] MC-33288: [2.4][MSI][MFTF] StorefrontLoggedInCustomerCreateOrderAllOptionQuantityConfigurableProductCustomStockTest fails because of bad design
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Component: Catalog Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch 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
Projects
None yet
Development

No branches or pull requests

7 participants