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

Fixed logging too many exceptions for payment methods #3181

Merged
merged 10 commits into from
Apr 28, 2023
Merged

Fixed logging too many exceptions for payment methods #3181

merged 10 commits into from
Apr 28, 2023

Conversation

fballiano
Copy link
Contributor

@fballiano fballiano commented Apr 15, 2023

In #3179 @addison74 pointed out that, using the backend, and opening an order detail page, some exceptions were logged about missing payment methods.

This is because the list of payment methods tries to load the model (for the payment method) and logs an exception if it's not found.

This is ok in some cases (when the order was paid with a method that has been removed later) but not in all the other cases.

So I thought to kinda rewrite the getPaymentMethodList method of Mage_Payment_Helper_Data.

If I'm not mistaken the before/after output of the getPaymentMethodList method stays the same:
before:
Screenshot 2023-04-15 alle 16 33 49

after:
Screenshot 2023-04-15 alle 16 33 21

Related Pull Requests

#2939

Fixed Issues

  1. Fixes exceptions.log - Errors and Warnings #3179

@github-actions github-actions bot added Component: Payment Relates to Mage_Payment Mage.php Relates to app/Mage.php labels Apr 15, 2023
@github-actions github-actions bot removed the Mage.php Relates to app/Mage.php label Apr 15, 2023
@addison74
Copy link
Contributor

addison74 commented Apr 15, 2023

This PR fixes Sales > Orders > View any Order. No more lines in exceptions.log.

We still have the same issue in Customers > Manage Customers > Edit any Customer. Will you create a new PR for Customers?

(PHP 8.1)

@fballiano
Copy link
Contributor Author

I thought it was the same but I’ll check it out asap!

@fballiano
Copy link
Contributor Author

@addison74 I've added the fix for the customer detail page in this PR because it was sharing part of the code ;-)

addison74
addison74 previously approved these changes Apr 16, 2023
Copy link
Contributor

@addison74 addison74 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested. No more warnings in the exceptions.log file related to the missing payment methods. For both sections in Backend (View Order and Edit Customer).

@fballiano fballiano requested a review from addison74 April 19, 2023 14:48
@fballiano fballiano merged commit 7664a35 into OpenMage:main Apr 28, 2023
@fballiano fballiano deleted the exception_payment_method branch April 28, 2023 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Payment Relates to Mage_Payment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

exceptions.log - Errors and Warnings
3 participants