Hi Daniele,
Hope you’re doing great! First off, congrats on getting Bricksforge 4.0.0 out the door—huge milestone.
We just updated one of our projects to 4.0.0 and caught a regression in how Pro Forms hydrates field values when brf_post_meta uses a nested dynamic tag for the post ID. To save you time digging around, our team already ran an isolation matrix to pinpoint exactly where the parser is tripping up.
1. Our Environment
- Bricksforge: 4.0.0 (regression appeared right after updating from 3.x)
- Bricks: 2.4.1 | WP: 7.1.2 | PHP: 8.3.33
- Server: Apache 2.4.68 (Debian) | DB: MariaDB 11.8.9
- Fields: Meta Box AIO 3.12.0 (standard
wp_postmetastorage, verified directly in DB)
2. What’s Happening
In our “edit” forms, we pre-populate fields using brf_post_meta with the post ID coming dynamically from a URL parameter:
{brf_post_meta:META_KEY:{url_parameter:post_id}}
In 3.x, the forms opened with all saved values pre-filled. In 4.0.0, this exact syntax resolves to an empty string inside Pro Forms fields, affecting:
- Text / Number field →
Value - Select → Option →
Conditionally Selected→Selected If Value - Checkbox →
Conditionally Checked→Checked If Value
(Important: If a user submits the form in this state, the empty/default values overwrite the existing postmeta in the database, causing silent data loss—like resetting statuses or unchecking active flags).
3. Isolation Matrix
We tested all variations on the exact same page request (...?post_id=45, same user, verified in wp_postmeta that post 45 holds escola_sigla_escola = "C M TIRADENTES"):
| # | Where the tag is placed | Tag | Result |
|---|---|---|---|
| A | Bricks Basic Text (outside form) | {url_parameter:post_id} |
45 |
| B | Bricks Basic Text (outside form) | {brf_post_title:{url_parameter:post_id}} |
|
| C | Bricks Basic Text (outside form) | {brf_post_meta:escola_sigla_escola:45} |
|
| D | Bricks Basic Text (outside form) | {brf_post_meta:escola_sigla_escola:{url_parameter:post_id}} |
|
| E | Pro Forms Text field → Value | {brf_post_title:{url_parameter:post_id}} |
|
| F | Pro Forms Text field → Value | {brf_post_meta:escola_sigla_escola:45} (Literal ID) |
|
| G | Pro Forms Text field → Value | {brf_post_meta:escola_sigla_escola:{url_parameter:post_id}} |
|
| H | Pro Forms Option / Checkbox Conditional | {brf_post_meta:KEY:{url_parameter:post_id}} |
As you can see:
{url_parameter:post_id}works inside the form when nested in a one-argument tag likebrf_post_title(E).brf_post_metaworks inside the form with a literal ID (F).- The full nested tag works right outside the form on the same render (D).
- It only fails inside Pro Forms field settings when
brf_post_meta(two arguments) receives its post ID from a nested tag (G, H).
4. Our Hypothesis (Just a lead)
I saw in the 4.0.0 changelog that brf_post_* tags were updated to return empty (instead of falling back to the current post) when the passed post ID resolves to nothing.
Looking at the matrix, our hunch is that in the Pro Forms field-rendering pipeline, the nested {url_parameter:post_id} isn’t being evaluated before brf_post_meta splits its arguments by :. Since the nested tag itself has a colon, the post ID argument probably arrives malformed/empty, triggering the new 4.0.0 empty return. That would also explain why brf_post_title (E) still works, since it doesn’t split a second argument.
5. Quick Steps to Reproduce
- Create a post (e.g., ID
123) with custom fieldbrf_test_key=hello. - On a page, add a Bricks Basic Text with
{brf_post_meta:brf_test_key:{url_parameter:post_id}}. - Add a Pro Forms element with two Text fields:
- Field 1 Value:
{brf_post_meta:brf_test_key:{url_parameter:post_id}} - Field 2 Value:
{brf_post_meta:brf_test_key:123}
- Load the page with
?post_id=123.
- Expected: Basic Text and both form fields output
hello. - Actual (4.0.0): Basic Text and Field 2 output
hello, while Field 1 is empty.
(Transparency note: In our production environment, these forms live inside a Bricks Popup template rendered on the page, and we haven’t yet stripped out all other plugins or tested outside the popup context. However, the workaround below confirms the form fields themselves are rendering dynamic data fine).
6. Current Workaround in Production
To keep production safe for now, we whitelisted a custom helper via bricks/code/echo_function_names ({echo:samar_popup_meta('META_KEY','POST_TYPE')}) that grabs $_GET['post_id'] directly. It works in all affected spots (Value, Selected If Value, and Checked If Value), confirming that Pro Forms fields evaluate dynamic tags properly in general—it’s really just the brf_post_meta + nested tag combo.
Let me know if you need any extra testing on our end!
Best regards,
Jayron Castro
CEO, Kstros.com