Fix "After Payment" setting not imported for Payment actions#3021
Fix "After Payment" setting not imported for Payment actions#3021AbdiTolesa wants to merge 2 commits intomasterfrom
Conversation
📝 WalkthroughWalkthroughAdded recursive array handling and duplicate-ID remapping in FrmFieldsHelper::switch_field_ids, and ensured FrmFormAction::duplicate_one applies switch_field_ids to array-valued Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment |
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| PHP | Mar 16, 2026 11:26a.m. | Review ↗ | |
| JavaScript | Mar 16, 2026 11:26a.m. | Review ↗ |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
classes/helpers/FrmFieldsHelper.php (1)
1828-1846:⚠️ Potential issue | 🟡 MinorAdd numeric field ID handling to prevent skipping integer IDs in nested arrays.
The direct mapping check at lines 1842-1846 only processes string values. Integer field IDs (e.g.,
123instead of"123") skip this check entirely due to thecontinueat line 1833, meaning nested integer field IDs won't be converted during duplication.While top-level numeric post_content values are handled by
duplicate_one()(line 392), nested numeric IDs within arrays need conversion. This is consistent with how FrmXMLHelper and FrmFormAction handle numeric field IDs elsewhere in the codebase.Proposed fix
if ( ! is_string( $v ) ) { if ( is_array( $v ) ) { $val[ $k ] = self::switch_field_ids( $v ); unset( $k, $v ); + } elseif ( is_numeric( $v ) && isset( $frm_duplicate_ids[ $v ] ) ) { + $val[ $k ] = $frm_duplicate_ids[ $v ]; + unset( $k, $v ); } continue; }
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 9aa835fe-e047-4fd9-800b-f6b466b69a25
📒 Files selected for processing (2)
classes/helpers/FrmFieldsHelper.phpclasses/models/FrmFormAction.php
Fix https://github.com/Strategy11/formidable-pro/issues/6377
Test steps
Summary by CodeRabbit