Skip to content

[Forwardport] Remove PDF files after generation#17280

Merged
magento-engcom-team merged 5 commits intomagento:2.3-developfrom
tiagosampaio:2.3-develop-PR-port-16401
Aug 10, 2018
Merged

[Forwardport] Remove PDF files after generation#17280
magento-engcom-team merged 5 commits intomagento:2.3-developfrom
tiagosampaio:2.3-develop-PR-port-16401

Conversation

@tiagosampaio
Copy link
Copy Markdown
Member

@tiagosampaio tiagosampaio commented Jul 30, 2018

Original Pull Request

#16401

Description

Upon invoice/packingslip/credit memo printing the system generates a PDF file directly in the var directory. I see no reason for keeping these files since they are not accessible publicly via web (sharing purpose). There's no "reuse" purpose as well since on every print action a new file with a new filename is being generated.
This PR provides a logic for removing a PDF file once it's generated.
Currently, it's implemented only within a scope of the invoice printing. Once we agree on the solution, I will adjust other places with PDF generation.

Fixed Issues (if relevant)

  1. Print pdf don't delete file in var folder #3535
  2. PDF invoices in /var folder #14517

Manual testing scenarios

  • Open an existing invoice in the admin panel.
  • Click the "Print" button.
  • You should have the invoice downloaded.
  • You should not have a generated PDF file in the var directory.

@magento-engcom-team
Copy link
Copy Markdown
Contributor

Hi @tiagosampaio. 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 {$VERSION} instance - deploy vanilla Magento instance

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

@miguelbalparda
Copy link
Copy Markdown
Contributor

@tiagosampaio I've seen you routinely port other devs code. I'd rather have the original author doing the back/forward port when possible and you porting everything that's available is not helping with that.

@tiagosampaio
Copy link
Copy Markdown
Member Author

@miguelbalparda as you wish, Sr.

@magento-engcom-team
Copy link
Copy Markdown
Contributor

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

@tiagosampaio tiagosampaio deleted the 2.3-develop-PR-port-16401 branch August 10, 2018 15:50
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.

5 participants