SOLVED: Form fields do not render when bricks template shortcodes are used inside ACF WYSIWYG fields

Browser: Chrome 110
OS: macOS / Windows
Video: Jam

See JAM attached above
I had this issue in more than just WYSIWYG fields on another site, so I create a raw site with nothing in it, and a brand new fresh install of Bricks 1.12.1.

You can see that when bricks templates are used inside various ACF field types, and those acf field values are used in various bricks template element types.

I have seen issues reported around this here and there, so I spent an hour crafting what I hope will really help with the bug hunting.

I have attached the posts, the bricks templates, and the ACF field groups for you to give it a go yourself. They expire in a week, so grab them now :slight_smile:

  1. Import the ACF fields, assign them to posts
  2. Import these posts
  3. Import these bricks templates.

There is a second bug I saw recently in a comment for others looking to solve why certain types of html elements were not rendering in ACF fields… but it was buried in a comment. And that bug is this: Bricks template shortcodes, when NOT published, are rendering when that shortcode is referenced in a Bricks text field. They are not rendered, when unpublished, when referenced in a bricks Shortcode element.

I hope this helps. Looking forward to a solution.

Quick update here. I had this ACF filter in play, which was causing me issues on the old site. The new site DID NOT have this. But, once I removed this, I did confirm that still in the WYSIWYG fields, the form fields do not render. So, not much a fix, but information in case anyone had tried adding a similar filter to make this work. All this filter did was make it NOT work even in the select and text ACF field types… but without it, at least it works on those, but NOT the wysiwyg fields, so still something wrong with the wysiwyg rendering of bricks template shortcodes.

// THIS WAS REMOVED BECAUSE IT ACTUALLY BROKE BRICKS FROM RENDERING ACF SHORTCODES IN ACF TEXT AND SELECT FIELD TYPES.  WYSIWYG ACF FIELDS STILL STRIP INPUT FIELDS FROM BRICKS TEMPLATE SHORTCODES

// add_filter('acf/format_value', function ($value, $post_id, $field) {
// 	// Only process on the front end and ensure value is a string
// 	if (!is_admin() && is_string($value)) {
// 		// Check if the value contains a shortcode
// 		if (strpos($value, '[') !== false && strpos($value, ']') !== false) {
// 			// Process shortcodes if detected
// 			$value = do_shortcode($value);
// 		}
// 	}
// 	return $value;
// }, 10, 3);

Hi @Wingtracer ,

Thanks for the Jam video.

Can you try to use {acf_my_wysiwyg @sanitize:false}

Regarding the shortcode still rendering if the template set as draft, that is a bug. I have recorded that in the bug tracker.

Regards,
Jenn

@sanitize DOES work, but, ONLY when the bricks template is referenced in wysiwyg acf field does the css render properly when set to external css. So, there is another bug, which we have been discussing via email, where external css does not work on acf fields referencing bricks template shortcodes in text or select fields.

We fixed this issue in Bricks 2.0 alpha, now available as a manual download in your account (see changelog).

Please let us know if you are still experiencing issues.

As with any pre-stable release, please do not use it on a production/live website. It is only meant for testing in a local or staging environment.