-
Notifications
You must be signed in to change notification settings - Fork 191
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: duplicate meta keys #7131
Fix: duplicate meta keys #7131
Conversation
@alaca should we also update |
@jonwaldstein good catch. Although it's not necessary, we should probably update it. Resolved! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alaca great job! ready for QA 🌈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passed manual QA test
Resolves GIVE-137
Description
This PR resolves the issue of duplicate donation forms. The problem was in the logic of the
get_earnings
method combined with the donation transfer logic which resulted in the meta key being duplicated on every page load. That also affected the donation forms list table which was displaying duplicated results.The issue is resolved by using
update_post_meta
instead ofadd_post_meta
function, and by adding a migration for deleting duplicated meta keys (_give_form_earnings
,_give_form_sales
) and setting the correct values for_give_form_earnings
is added.Affects
Donation Forms list table
Donation Form data transfer
Testing Instructions
The best way to test this is on an existing site that has this problem.
Create a new site by using Local or something similar.
Install All-In-On WP Migration plugin.
Download the site backup and import it (https://drive.google.com/file/d/16SIlaCQ-1nMvneFpYvdLStA2_ovtQ6vG/view?usp=sharing).
After import, verify that the problem exists by checking the donation forms list table, or even better by querying the
give_formmeta
table. Something like:Now delete or disable the existing Give plugin and install Give from GitHub repo.
Switch to this branch
fix/duplicate-meta-keys
Check the donation forms list table.
Pre-review Checklist
@unreleased
tags included in DocBlocks