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: improve deletion of test data #2473

Closed
4 tasks done
Benunc opened this issue Dec 7, 2017 · 3 comments
Closed
4 tasks done

fix: improve deletion of test data #2473

Benunc opened this issue Dec 7, 2017 · 3 comments
Assignees

Comments

@Benunc
Copy link
Member

Benunc commented Dec 7, 2017

Issue Overview

Currently deleting the test data at Donations > Tools > Data (tab) deletes donations made when give is in test mode, but not donations made with the test gateway in live mode.

Expected Behavior

Test donations of all types should be deleted.

Current Behavior

Only donations that are made in test mode are deleted.

Possible Solution

Add a check for test gateway during the deletion process.
Related to this, it would be nice to "wipe the slate clean" of only donation data and NOT delete the forms. For when (for example) you want to delete all data but leave forms.

Steps to Reproduce (for bugs)

  1. Create donations in both test and live mode (payment gateways -> enabled/disabled) while using the test gateway.
  2. navigate to donations > tools > data (tab) and delete the Test payments
  3. navigate back to Donations > Donations
  4. only donations made while give is in test mode are deleted.

Acceptance Criteria

  • When Delete Test Donations is selected, it deletes all donations where _give_payment_mode === test (where test indicates any donation made while in Test Mode)
  • When Delete Test Donations is selected, it also deletes all donations where _give_payment_gateway === manual (where manual indicates a donation through the Test Donation gateway).
  • The description reads: Deletes all donations made in Test Mode and all donations made through the Test Donation gateway in Live Mode.
  • The same donations are deleted when Delete Test Donors and Donations is selected.
@DevinWalker DevinWalker added this to the 2.2 milestone Dec 11, 2017
@DevinWalker DevinWalker removed this from the 2.2 milestone Mar 6, 2018
@kevinwhoffman kevinwhoffman changed the title Deleting Test data should delete all donation made with test gateway. fix(admin-tool): improve deletion of test data Mar 12, 2018
@kakshak
Copy link

kakshak commented Oct 11, 2018

@kevinwhoffman Actually, I am confused with this issue behavior. Because if a user selects Delete Test Donations from Donations > Tools > Data (tab) then it should delete the all the test donations NOT all(live + test) types of donations. It is intended behavior.

Please let me know your thoughts on this.

@kevinwhoffman kevinwhoffman changed the title fix(admin-tool): improve deletion of test data fix: improve deletion of test data Oct 11, 2018
@kevinwhoffman
Copy link
Contributor

Here's my understanding of what @Benunc is asking to delete when Delete Test Donations is selected:

  • All donations made through any gateway while Test Mode is enabled.
    • This means delete all donations where _give_payment_mode = test.
  • In addition, all donations made with the Test Donation gateway in Live mode.
    • This means delete all donations where _give_payment_gateway = manual.

Acceptance criteria have been updated accordingly.

@kevinwhoffman
Copy link
Contributor

kevinwhoffman commented Oct 11, 2018

@kakshak There are 2 queries that need modified. Add a meta query with 'relation' => 'OR' to look for either of the two meta keys as described above.

This query runs whenever Delete Test Donations is selected:
https://github.com/impress-org/give/blob/f3cb229d3d020e00c06e47208b4919790249072f/includes/admin/tools/data/class-give-tools-delete-test-transactions.php#L187-L192

This query runs whenever Delete Test Donors and Donations is selected:
https://github.com/impress-org/give/blob/f3cb229d3d020e00c06e47208b4919790249072f/includes/admin/tools/data/class-give-tools-delete-test-donors.php#L167-L175

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

No branches or pull requests

4 participants