SOLVED: Form redirect within query references parent page, not current query object (using ACF)

Browser: Brave Version 1.74.51 Chromium: 132.0.6834.160 (Official Build) (64-bit)
OS: Windows 10
URL: Page no longer has issue, but contains the relevant form - Click button to show form
Video: Too hard to capture the subtleties of this in a video

Overview
When embedding a Bricks form within a query, the redirect field references the parent page post (the page on which this content is embedded), not the current CPT post object.

Note: These two objects are connected by an ACF bidirectional relationship field. The query is created by specifying the ID from the associated CPT.

I know that the form is generally referencing the current CPT post object, as it pulls other dynamic data correctly.
e.g. I can set the button text to “Get the {acf_download_descriptor}” where the “acf_download_descriptor” is a custom value from the current CPT post object, not the parent page post object.

Expected Behaviour
I should be able to enter the dynamic data {post_url} into the “Custom redirect url” field, and have the form redirect to the URL of the CPT.

Observed Behaviour
Instead, the form redirects to the parent page URL. To get the form to behave as expected, I need to use
{acf_landing_page_download:url}
which is a custom field attached to the parent page post object, NOT the current CPT post object.

Steps to Reproduce

  1. Set up a CPT using Advanced Custom Fields.
  2. Create a bidirectional relationship between this CPT and pages, named something like associated_page and associated_cpt respectively.
  3. Create a CPT with some content (and optionally some custom fields). Give it a unique title.
  4. Create a page that displays content from the associated CPT via a query. Give the page a unique and different title.
  5. Add a form to the content within the query.
  6. Pull the button label dynamically from the CPT (eg using post_title) and see that it is displaying the correct value on the button
  7. Set a redirect on successful submit that goes to the CPT page using {post_url} in the “Custom redirect url” field
  8. Submit the form
  9. Observe that the form redirects to the parent page URL, not the CPT post URL
  10. Now use {acf_associated_cpt:url} instead in the “Custom redirect url” field
  11. Submit the form again
  12. Observe that the form now correctly redirects to the CPT URL, not the parent page URL

Hi @thebizpixie,

thank you for the detailed report. I was able to replicate the issue, and I’ve added it to the internal bug tracker.

Best regards,
Matej

Dear @thebizpixie,

It seems we missed this before, but it should be working now since a few versions ago.

Best regards,
Matej

1 Like