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

Refactor: update meta persistence in donor and donation repositories #7679

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

jonwaldstein
Copy link
Contributor

@jonwaldstein jonwaldstein commented Jan 16, 2025

Partially Resolves GIVE-2075

Description

This updates our donor and donation repositories to use the native WP meta functions for adding meta instead of directly inserting using SQL.

Before this, we were innocently deviating from how WordPress stores meta values, effectively bypasses some of the extra filters/sanitization of values. This resulted in problems downstream when retrieving the data.

So the lesson learned here is to always use the native WordPress api functions for storing and retrieving meta 😄.

Affects

  • Creating new donations and donors (v2 and v3 forms)

Visuals

Screenshot 2025-01-16 at 10 09 14 AM Screenshot 2025-01-16 at 10 11 43 AM

Testing Instructions

Make sure both v2 and v3 forms are working as expected.

  • Create donation using v3 form and make sure core blocks/fields and custom fields are processing correctly
  • Check the confirmation page, donation and donor details to make sure
  • Repeat for v2 forms

Pre-review Checklist

  • Acceptance criteria satisfied and marked in related issue
  • Relevant @unreleased tags included in DocBlocks
  • Includes unit tests
  • Reviewed by the designer (if follows a design)
  • Self Review of code and UX completed

@jonwaldstein jonwaldstein marked this pull request as ready for review January 16, 2025 17:49
@jonwaldstein jonwaldstein requested a review from kjohnson January 16, 2025 17:49
Copy link
Member

@kjohnson kjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Nice and straightforward PR with tests 🙌🏻

@kjohnson
Copy link
Member

Build for QA, see https://github.com/impress-org/givewp/actions/runs/12815846433.

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

Successfully merging this pull request may close these issues.

2 participants