impress-org / givewp

GiveWP - The #1 Donation Plugin for WordPress. Easily accept donations and fundraise using your WordPress website.
https://givewp.com/
GNU General Public License v3.0
344 stars 191 forks source link

fix: prevent fatal error when click on resend receipt #4068

Closed ravinderk closed 5 years ago

ravinderk commented 5 years ago

Bug Report

User Story

As an admin, I want to resend receipt without any failure.

ref: https://secure.helpscout.net/conversation/796694823/35676?folderId=848135#thread-2266009265

Current Behavior

I am getting a fatal error when click on resend receipt. image image

Expected Behavior

Resend receipt without any fatal error.

Bug Type

Steps to Reproduce

  1. Add {donation_history_link} or {subscriptions_link} [or both] email to receipt
  2. Click on resend receipt button for any of donation
  3. you will get an error:
    Call to a member function set_verify_key() on a non-object in /wp-content/plugins/give/includes/emails/class-give-email-tags.php on line 1238

Visuals

image

Possible Solution

Above mentioned email tags use Give_Email_Access class in logic but after refactoring that class only available only on the frontend, so to prevent fatal error we can load this class as backward compatibility on specific resend receipt event [ either bulk or single]

To prevent fatal error we can load this class for this email tag code. ref: https://github.com/impress-org/give/issues/3871

Acceptance Criteria

Benunc commented 5 years ago

Another user reported the same issue with offline donations. To reproduce:

  1. Add the {donation_history_link} tag to the donation dreceipt email.
  2. Submit an offline donation from the front end
  3. Manually mark the donation as complete on the back end.

Error!

ravinderk commented 5 years ago

@Benunc I reviewed the above issue and confirming that it will be fixed by https://github.com/impress-org/give/pull/4069

ravinderk commented 5 years ago

Note: I can reproduce same with subscriptions_link email tag from recurring addon. I updated acceptance criteria of this issue.