Repository navigation
Expose form session unlocking for dynamic collections - #46
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #46 +/- ##
===========================================
Coverage 100.00% 100.00%
- Complexity 1088 1090 +2
===========================================
Files 120 120
Lines 2935 2942 +7
===========================================
+ Hits 2935 2942 +7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Queue successfully rendered submissions until token generation so explicit collection unlocks apply to existing and future controls. Build tokens from a cloned protector to support unlocking after a failed closing template. Cover root and nested collections, hidden values, protected siblings, and closing retries. Document that unlock() may be called before or after rendering controls.
|
@codex review this |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Forms with JavaScript-managed collections can submit rows that were added or removed after rendering. Applications currently need custom session and lifecycle subclasses to allow these changes through CakePHP form protection.
Add
FormSession::unlock(string $path): voidfor explicitly unlocking a field or collection while its form is open. The lifecycle enforces the open-session requirement and delegates to the existing protection service. Other fields and form sessions retain their protection.Includes a documented collection example and regression tests for changed or omitted rows, tampering with other fields, session isolation, invalid lifecycle phases, and forms without protection.
Validation:
composer validate --strictcomposer check: 810 tests, 3,199 assertions; analysis, lint, Rector, and formatting passcomposer test-coverage: 100% line coverage (2,514/2,514); greater-than-90% gate passesnpm run docs:build