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

Fix error when payment methods have been deleted #2772

Merged
merged 1 commit into from
Dec 2, 2022
Merged

Fix error when payment methods have been deleted #2772

merged 1 commit into from
Dec 2, 2022

Conversation

sreichel
Copy link
Contributor

@sreichel sreichel commented Dec 2, 2022

Fixed Issues (if relevant)

  1. Fixes Bug: Fatal error in salesOrderBeforeSave event for deleted payment #280

Manual testing scenarios (*)

  1. delete payment method that is used for existing orders
  2. go to admin orders

Questions or comments

Related code: (can return false)

    /**
     * Retrieve order payment model object
     *
     * @return Mage_Sales_Model_Order_Payment|false
     */
    public function getPayment()
    {
        foreach ($this->getPaymentsCollection() as $payment) {
            if (!$payment->isDeleted()) {
                return $payment;
            }
        }
        return false;
    }

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All automated tests passed successfully (all builds are green)
  • Add yourself to contributors list

@github-actions github-actions bot added the Component: Payment Relates to Mage_Payment label Dec 2, 2022
@fballiano fballiano merged commit f835cb6 into OpenMage:1.9.4.x Dec 2, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Dec 2, 2022

Unit Test Results

1 files  ±0  1 suites  ±0   0s ⏱️ ±0s
0 tests ±0  0 ✔️ ±0  0 💤 ±0  0 ❌ ±0 
7 runs  ±0  5 ✔️ ±0  2 💤 ±0  0 ❌ ±0 

Results for commit f835cb6. ± Comparison against base commit 2e5b42e.

@sreichel sreichel deleted the hotfix/deleted-payment-method branch December 2, 2022 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Fatal error in salesOrderBeforeSave event for deleted payment
3 participants