You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add hooks to show a View in the Confirmation action - #3651
Adds the Lite hooks Formidable Views needs to offer a View as a Confirmation action option, next to page content. All of the View logic lives in Views. Lite only gets two filters and one new arg.
Changes
frm_on_submit_types filter in on_submit_settings.php. Add-ons can change the label and settings callback of the Confirmation types. Views uses it to relabel the page type "Show Page or View" and add a Page/View choice with a View picker.
frm_on_submit_page_output filter in FrmFormsController::load_page_after_submit(). When a callback returns a string, it is shown instead of the page content. Views uses it when the selected post is a View.
$args['on_submit_action'] is now set in the single-action path of run_on_submit_actions() and in get_run_success_action_args(), so the output filter knows which Confirmation action is running. Views uses it to show the submitted entry, or the View listing, based on an action setting.
Without Views active, nothing changes. Both filters default to the current behavior.
Testing
Tested with the companion Views change, which stores the View ID in the existing success_page_id setting.
Edit a form's Confirmation action. The third type reads "Show Page or View". Pick View, choose a View, set Show to "The submitted entry", and save.
Submit the form, both normal and ajax. A dynamic View shows its detail page for the new entry, and a list View shows only the new entry. With Show set to "The View listing", the normal listing shows.
Two matching Confirmation actions (a message plus a View) both render. This covers get_run_success_action_args().
Regression: Show Page Content with a normal page, Show Message, and Redirect to URL all behave as before.
With Views deactivated, the Confirmation settings and output are unchanged.
Review notes
echo $output in load_page_after_submit() carries a phpcs:ignore for OutputNotEscaped, matching how the method already echoes the_content output. Please confirm this is acceptable.
Add the frm_on_submit_types filter so add-ons can change the
Confirmation action types and their settings, and the
frm_on_submit_page_output filter so they can replace the output of
the page type. Pass the running Confirmation action to
run_success_action() as on_submit_action so that output can depend
on the action's settings.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
We reviewed changes in ff302be...c7761c5 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.
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.
We reviewed changes in 85479d8...4386350 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.
Some issues found as part of this review are outside of the diff in this pull request and aren't shown in the inline review comments due to GitHub's API limitations. You can see those issues on the DeepSource dashboard.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the Lite hooks Formidable Views needs to offer a View as a Confirmation action option, next to page content. All of the View logic lives in Views. Lite only gets two filters and one new arg.
Changes
frm_on_submit_typesfilter inon_submit_settings.php. Add-ons can change the label and settings callback of the Confirmation types. Views uses it to relabel the page type "Show Page or View" and add a Page/View choice with a View picker.frm_on_submit_page_outputfilter inFrmFormsController::load_page_after_submit(). When a callback returns a string, it is shown instead of the page content. Views uses it when the selected post is a View.$args['on_submit_action']is now set in the single-action path ofrun_on_submit_actions()and inget_run_success_action_args(), so the output filter knows which Confirmation action is running. Views uses it to show the submitted entry, or the View listing, based on an action setting.Without Views active, nothing changes. Both filters default to the current behavior.
Testing
Tested with the companion Views change, which stores the View ID in the existing
success_page_idsetting.get_run_success_action_args().Review notes
echo $outputinload_page_after_submit()carries aphpcs:ignoreforOutputNotEscaped, matching how the method already echoesthe_contentoutput. Please confirm this is acceptable.🤖 Generated with Claude Code