Skip to content

fix: guard missing delete modal payments (#1847) - #1850

Merged
superdav42 merged 3 commits into
mainfrom
feature/auto-20260910-082449-gh1847
Sep 10, 2026
Merged

fix: guard missing delete modal payments (#1847)#1850
superdav42 merged 3 commits into
mainfrom
feature/auto-20260910-082449-gh1847

Conversation

@superdav42

@superdav42 superdav42 commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Guard missing payments before resolving their line items in the delete confirmation modal.

Testing

  • php -l inc/admin-pages/class-payment-edit-admin-page.php
  • vendor/bin/phpcs inc/admin-pages/class-payment-edit-admin-page.php
  • vendor/bin/phpstan analyse inc/admin-pages/class-payment-edit-admin-page.php --no-progress

Resolves #1847


aidevops.sh v3.32.317 plugin for OpenCode v1.18.30 with gpt-5.6-terra

Summary by CodeRabbit

  • Bug Fixes
    • Improved validation when opening the payment line-item deletion dialog, preventing invalid or missing payments from exposing payment details.
    • The dialog now produces no output when the referenced payment cannot be found.

@superdav42 superdav42 added the origin:worker Auto-created by pulse labelless backfill (t2112) label Sep 10, 2026
@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 47b7baae-da4b-46ff-80b4-d537cb27c18b

📥 Commits

Reviewing files that changed from the base of the PR and between e539a29 and c8eb713.

📒 Files selected for processing (2)
  • inc/admin-pages/class-payment-edit-admin-page.php
  • tests/WP_Ultimo/Admin_Pages/Payment_Edit_Admin_Page_Test.php

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

The payment deletion modal now checks for an existing payment before accessing its ID. The missing-payment test expects an empty response without exception handling. A renewal-date fixture comment documents the intentionally low day value.

Changes

Payment deletion modal

Layer / File(s) Summary
Payment existence guard
inc/admin-pages/class-payment-edit-admin-page.php
The deletion modal returns early when the payment lookup fails, before accessing the payment ID.
Modal test coverage
tests/WP_Ultimo/Admin_Pages/Payment_Edit_Admin_Page_Test.php
The missing-payment test asserts empty output without exception handling. A comment documents the fixed renewal date day used by the test.

Estimated code review effort: 2 (Simple) | ~10 minutes

Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to c8eb7

The deletion modal now safely handles missing payments without a fatal error, and the regression coverage confirms the empty response behavior. No actionable merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the primary change: guarding the delete modal when the payment is missing.
Linked Issues check ✅ Passed The changes satisfy the linked issue objectives [#1847]. The modal now returns before resolving line items for a missing payment, the regression test expects empty output, and the test documents why t…
Out of Scope Changes check ✅ Passed All changes remain within scope [#1847]. The implementation change and related test updates directly address missing-payment handling and stable manual-payment date testing.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/auto-20260910-082449-gh1847

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

🔨 Build Complete - Ready for Testing!

📦 Download Build Artifact (Recommended)

Download the zip build, upload to WordPress and test:

🌐 Test in WordPress Playground (Very Experimental)

Click the link below to instantly test this PR in your browser - no installation needed!
Playground support for multisite is very limitied, hopefully it will get better in the future.

🚀 Launch in Playground

Login credentials: admin / password

@superdav42

superdav42 commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator Author

Merge summary

  • Missing payments now return before their line items are resolved in the delete confirmation modal.
  • The regression test requires an empty early return instead of accepting a fatal error.
  • The manual-confirmation test documents why its date uses day 09.

Verification

  • vendor/bin/phpunit --filter Payment_Edit_Admin_Page_Test — 66 tests passed; 4 existing skips.
  • vendor/bin/phpcs inc/admin-pages/class-payment-edit-admin-page.php tests/WP_Ultimo/Admin_Pages/Payment_Edit_Admin_Page_Test.php
  • vendor/bin/phpstan analyse inc/admin-pages/class-payment-edit-admin-page.php --no-progress

aidevops.sh v3.32.317 plugin for OpenCode v1.18.30 with gpt-5.6-terra spent 8m and 145,377 tokens on this as a headless worker.


Merged via PR #1850 to main.
Merged by deterministic merge pass (pulse-wrapper.sh).

@superdav42
superdav42 marked this pull request as ready for review September 10, 2026 14:35
@github-actions

Copy link
Copy Markdown

🔨 Build Complete - Ready for Testing!

📦 Download Build Artifact (Recommended)

Download the zip build, upload to WordPress and test:

🌐 Test in WordPress Playground (Very Experimental)

Click the link below to instantly test this PR in your browser - no installation needed!
Playground support for multisite is very limitied, hopefully it will get better in the future.

🚀 Launch in Playground

Login credentials: admin / password

@github-actions

Copy link
Copy Markdown

Performance Test Results

Performance test results for df574f4 are in 🛎️!

@ultimate-multisite ultimate-multisite Bot added the status:in-review PR open, awaiting review/merge label Sep 10, 2026
@github-actions

Copy link
Copy Markdown

🔨 Build Complete - Ready for Testing!

📦 Download Build Artifact (Recommended)

Download the zip build, upload to WordPress and test:

🌐 Test in WordPress Playground (Very Experimental)

Click the link below to instantly test this PR in your browser - no installation needed!
Playground support for multisite is very limitied, hopefully it will get better in the future.

🚀 Launch in Playground

Login credentials: admin / password

@superdav42
superdav42 merged commit 5b11251 into main Sep 10, 2026
11 checks passed
@superdav42 superdav42 added the review-feedback-scanned Merged PR already scanned for quality feedback label Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

origin:worker Auto-created by pulse labelless backfill (t2112) review-feedback-scanned Merged PR already scanned for quality feedback status:in-review PR open, awaiting review/merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Review followup: PR #1831 — GH#1818: preserve the initial Manual payment period

1 participant