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
339 stars 191 forks source link

bulk action in legacy give-payment-history page broken #7158

Closed pulsovi closed 3 months ago

pulsovi commented 8 months ago

User Story

As an admin, I want resend receipt for some donations.

Details

nonce checking fail with message "We are unable to recognize your session. Please refresh the screen to try again; otherwise contact your website administrator for assistance" (wp_die)

Expected Behavior

The receipts must be resend and I to go back on the payments history list table

Steps to Reproduce

  1. add some translation for the "Forms" string in the give plugin (I use locotranslate)
  2. go to the back-office, and in the menu go to the payment history page.
  3. Click on "Switch to legacy view"
  4. Select some donations
  5. choose "resend receipt" in the bulk action list.
  6. Click on the submit button

=> get error page with the message :

"We are unable to recognize your session. Please refresh the screen to try again; otherwise contact your website administrator for assistance"

Acceptance Criteria

Suggested resolution

The bug seems to come from the fact that the $action passed to the nonce check in the next two calls is assumed to be "bulk-forms".

https://github.com/impress-org/givewp/blob/179d6c46d5d89f7597b567b2ace070c0cab93e12/includes/admin/admin-actions.php#L147 And https://github.com/impress-org/givewp/blob/179d6c46d5d89f7597b567b2ace070c0cab93e12/includes/admin/payments/class-payments-table.php#L815

While its true value is 'bulk-' . sanitize_key(give_get_forms_label_plural())

Which is defined as follows:

github-actions[bot] commented 7 months ago

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 14 additional days. Note, if this Issue is reporting a bug, please reach out to our support at https://givewp.com/support. If this is a feature request, please see our feedback board at feedback.givewp.com — that’s the best place to make feature requests, unless you’re providing a PR.

pulsovi commented 6 months ago

want a PR ?

github-actions[bot] commented 5 months ago

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 14 additional days. Note, if this Issue is reporting a bug, please reach out to our support at https://givewp.com/support. If this is a feature request, please see our feedback board at feedback.givewp.com — that’s the best place to make feature requests, unless you’re providing a PR.

pulsovi commented 5 months ago

I have little time at the moment, but I plan to do a PR within 4 weeks. Please don't close the conversation.

github-actions[bot] commented 3 months ago

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 14 additional days. Note, if this Issue is reporting a bug, please reach out to our support at https://givewp.com/support. If this is a feature request, please see our feedback board at feedback.givewp.com — that’s the best place to make feature requests, unless you’re providing a PR.

pulsovi commented 3 months ago

I see that the bug has already been fixed by someone else. So much the better.

7204