Skip to content

Five for the Future: Pledge form handling updates - #414

Merged
obenland merged 3 commits into
productionfrom
update/pledge-attachment-and-state
Sep 11, 2026
Merged

obenland merged 3 commits into
productionfrom
update/pledge-attachment-and-state

Conversation

@obenland

Copy link
Copy Markdown
Member

Three related bits of housekeeping around the pledge form.

Name the pledge logo after the pledge. media_handle_sideload() was called with neither a description nor post overrides, so core filled the attachment's title and content from the image file's own IPTC and EXIF records. The content is stored through the post kses profile and rendered on the attachment's page by the block theme. The sideload now passes the organization's name, pins the content, and discards the free-text metadata the file carries about itself.

Limit email confirmation to pledges awaiting it. The confirmation handler published whatever pledge its token named, and the resend handler issued a fresh token for any unconfirmed pledge, neither looking at the pledge's state. Both are now confined to pledges that are still live, and deactivate() drops the outstanding token so a link already sent stops working.

Accept only pending invitations to live pledges. The join branch accepted any invitation that was not already published — including ones a sponsor had removed — and never checked the parent pledge. It now requires a pending invitation and a published pledge, and says so when neither holds instead of reporting a join that did not happen.

Testing

New coverage in test-pledge-form.php, test-pledge.php and test-contributor.php. Each new test was confirmed to fail against the previous behaviour before the change. Full suite: 43 tests, 186 assertions, green. phpcs output for the plugin is unchanged from production.

🤖 Generated with Claude Code

obenland and others added 3 commits September 11, 2026 14:15
`media_handle_sideload()` fills an attachment's title and content from the image
file's own IPTC and EXIF records when the caller passes neither a description nor
post overrides, so an uploaded logo decided what its attachment said. The content
is stored through the post kses profile, which keeps `data-*` attributes, and the
block theme renders it on the attachment's page.

Pass the organization's name, pin the content, and discard the free-text metadata
the file carries about itself.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The confirmation handler published whatever pledge its token named, and the
resend handler issued a fresh token for any unconfirmed pledge, neither of them
looking at the state the pledge was in. A pledge an administrator had taken out
of view could be put back by following a link.

Confine both handlers to pledges that are still live, and drop the outstanding
token when a pledge is deactivated so a link already sent stops working.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The join branch accepted any invitation that was not already published, which
included ones a sponsor had removed, and it never looked at the pledge the
invitation belonged to. Nonces stay valid for hours, so a removed invitee could
submit one afterwards and restore the association.

Require a pending invitation and a published pledge, and say so plainly when
neither holds rather than reporting a join that did not happen.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 11, 2026 19:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@obenland
obenland merged commit 0a21636 into production Sep 11, 2026
2 checks passed
@obenland
obenland deleted the update/pledge-attachment-and-state branch September 11, 2026 19:35
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