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

Invoice PDF payment method rendering broken in v19.4.12 #1548

Closed
rfeese opened this issue Apr 14, 2021 · 7 comments
Closed

Invoice PDF payment method rendering broken in v19.4.12 #1548

rfeese opened this issue Apr 14, 2021 · 7 comments

Comments

@rfeese
Copy link
Contributor

rfeese commented Apr 14, 2021

Preconditions (*)

  1. v19.4.12
  2. Pull request that created the issue: Fix wrong payment info template paths #1201

Steps to reproduce (*)

  1. Navigate to an existing Sales Order Invoice in admin area.
  2. Click Print button
  3. Check Payment method section of the invoice, it is corrupted due to applying an HTML template instead of PDF.

Expected result (*)

  1. The payment method section of the invoice PDF should be rendered using the default PDF template.

Actual result (*)

  1. The payment method section of the invoice PDF is rendered using the HTML template, which breaks the PDF formatting.

Magento-LTS core does not appear to contain PDF email attachment options that the author of the pull request mentioned, so I suspect they may have been using an add-on module which may contain a bug. The PDF payment templates certainly do exist (https://github.com/OpenMage/magento-lts/tree/1.9.4.x/app/design/adminhtml/default/default/template/payment/info/pdf).

@rfeese rfeese added the bug label Apr 14, 2021
@kiatng
Copy link
Contributor

kiatng commented Apr 15, 2021

The payment block Mage_Payment_Block_Info is retrieved from the helper (L322)

/* Payment */
$paymentInfo = Mage::helper('payment')->getInfoBlock($order->getPayment())
->setIsSecureMode(true)
->toPdf();
$paymentInfo = htmlspecialchars_decode($paymentInfo, ENT_QUOTES);
$payment = explode('{{pdf_row_separator}}', $paymentInfo);

But the function toPdf(), due to the PR, now returns the HTML template instead of the PDF template.

@colinmollenhour
Copy link
Member

Any idea what the fix should be? Should #1201 simply be reverted?

@kiatng
Copy link
Contributor

kiatng commented Apr 22, 2021

Yes, the PR needs to be reverted.

@rfeese
Copy link
Contributor Author

rfeese commented Sep 2, 2021

I agree, the solution is to revert #1201, which I have had to do in a local repo. Is there a way I could help by making a PR that reverts the #1201 PR or is it easier for a maintainer to perform this using the github UI? Sorry, I am a github newb.

@addison74
Copy link
Contributor

Did anyone revert PR #1201? If yes we should close this issue.

@fballiano
Copy link
Contributor

It wasn't reverted but I created PR #2179 to revert it

@fballiano
Copy link
Contributor

closing since #2179 was merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants