Skip to content

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

@ddznelad

Description

@ddznelad

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: CatalogIssue: Cannot ReproduceCannot reproduce the issue on the latest `2.4-develop` branchIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentbug report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions