Skip to content

Fix duplicate legacy paypal action created on create#3124

Merged
Crabcyborg merged 1 commit into
masterfrom
fix_duplicate_legacy_paypal_action_created_on_create
Jun 5, 2026
Merged

Fix duplicate legacy paypal action created on create#3124
Crabcyborg merged 1 commit into
masterfrom
fix_duplicate_legacy_paypal_action_created_on_create

Conversation

@Crabcyborg
Copy link
Copy Markdown
Contributor

@Crabcyborg Crabcyborg commented Jun 5, 2026

I'm noticing this bug with the new payment action changes.

When I create a legacy PayPal action and save, it would create a second legacy PayPal action.

It looks like changing option name here as well fixes it.

Summary by CodeRabbit

Bug Fixes

  • Fixed namespace collision between legacy PayPal actions and PayPal add-on actions, ensuring each maintains its own separate option storage and preventing data conflicts between the two payment systems.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 5, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9d87bd14-848e-4b37-a4b9-92f6c49b8b4d

📥 Commits

Reviewing files that changed from the base of the PR and between 6bdea48 and baf87dd.

📒 Files selected for processing (1)
  • classes/views/frm-form-actions/default_actions.php

📝 Walkthrough

Walkthrough

The PR modifies the legacy PayPal action constructor to recalculate its option_name based on the new id_base value, ensuring the action uses a distinct POST data/options namespace from the PayPal add-on action and avoiding collision.

Changes

PayPal Legacy Action Namespace Isolation

Layer / File(s) Summary
Legacy PayPal action option_name recalculation
classes/views/frm-form-actions/default_actions.php
The FrmDefPayPalLegacyAction constructor now explicitly sets option_name to frm_paypal-legacy_action after setting id_base, with clarifying comments explaining the namespace isolation from the PayPal add-on action.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • Strategy11/formidable-forms#3108: Updates FrmFormActionsController to include paypal-legacy in the returned action lists when registered, complementing this PR's namespace fix.
  • Strategy11/formidable-forms#3106: Stops "PayPal Commerce" from appearing on the legacy action, aligning with this PR's goal of isolating the legacy PayPal action's namespace.

Poem

A rabbit hops through namespaces clear,
paypal-legacy now holds its sphere—
No collision, no mix-up in sight,
Each action distinct, perfectly right! 🐰✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: fixing duplicate legacy PayPal actions created on save by correcting the namespace collision.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 fix_duplicate_legacy_paypal_action_created_on_create

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 and usage tips.

@deepsource-io
Copy link
Copy Markdown

deepsource-io Bot commented Jun 5, 2026

DeepSource Code Review

We reviewed changes in 6bdea48...baf87dd on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
PHP Jun 5, 2026 12:24p.m. Review ↗
JavaScript Jun 5, 2026 12:24p.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

// id_base. Recompute it from the new id_base so this action does not share the
// POST data namespace with the PayPal add-on's 'paypal' action, which would make
// both action controls save the same submission and create a duplicate action.
$this->option_name = 'frm_' . $this->id_base . '_action';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Access to an undefined property FrmDefPayPalLegacyAction::$option_name


This issue is raised when an attempt is made to access an undefined property.
This may not have been intended, and it is advisable to give the code another look to make sure the property is defined in the scope it is used in.

@Crabcyborg Crabcyborg merged commit b7cd07c into master Jun 5, 2026
38 of 48 checks passed
@Crabcyborg Crabcyborg deleted the fix_duplicate_legacy_paypal_action_created_on_create branch June 5, 2026 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant