SOLVED: ACF Dynamic Data reference lost during template import when image field contains SVG

When importing a Bricks template containing an Image or Logo element with an ACF/SCF dynamic image source, the dynamic data reference is lost if the source field contains an SVG image.

Instead of preserving the dynamic data reference, Bricks replaces the image settings with a placeholder SVG.

When the same dynamic image field contains a PNG or JPG image instead, the dynamic data reference is preserved during import.

Steps to reproduce

  1. Create an ACF/SCF image field on an Options Page (e.g. brand_logo).

  2. Assign an SVG image to this field.

  3. Add an Image or Logo element to a Bricks template and set its dynamic image source to {acf_brand_logo}.

  4. Export the template using Bricks’ native export functionality.

  5. Import the template into another WordPress site with image importing disabled.

  6. Check the element’s image settings.

Actual behavior

The dynamic data reference {acf_brand_logo} is removed and replaced with a placeholder SVG.

Expected behavior

The dynamic data reference {acf_brand_logo} should remain unchanged, regardless of the image format stored in the field.

Workaround

Changing the image stored in the source site’s SCF field from SVG to PNG resolves the issue. With the same dynamic data reference {acf_brand_logo}, the template imports correctly.

Possible cause

In includes/templates.php, Templates::is_image() identifies SVG images based on their URL, even when the image settings contain useDynamicData.

This appears to trigger the image import/replacement process, which replaces the entire image settings object instead of preserving the dynamic data reference.

Thanks for the report. We were able to replicate this issue and added it to our internal bug tracker. We’ll update this thread once it’s fixed.

We’ve addressed this in Bricks 2.5-rc (release candidate), now available for manual download from your Bricks account.

Please read the changelog entry before testing, and let us know if you experience any issues. Release candidates are not intended for production sites.