# ACF Blocks broken for me. Simple fix required?

**URL:** <https://forum.pinegrow.com/t/acf-blocks-broken-for-me-simple-fix-required/8380>\
**Category:** Bug Reports\
**Tags:** blocks, acf, acfpro\
**Created:** [September 20, 2023, 11:38pm UTC](https://forum.pinegrow.com/t/acf-blocks-broken-for-me-simple-fix-required/8380 "2023-09-20T23:38:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bryn](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/bryn/32/5487_2.png) [@Bryn](https://forum.pinegrow.com/u/Bryn)\
**Post date:** [September 20, 2023, 11:38pm UTC](https://forum.pinegrow.com/t/acf-blocks-broken-for-me-simple-fix-required/8380/1 "2023-09-20T23:38:49Z")

</div>

This is the generated code I see for an ACF test block:

```auto
/* Creating Editor Blocks with ACF PRO */

function test_blocks_acf_blocks_init() {

    // Check if ACF PRO function exists.
    if( function_exists('acf_register_block_type') ) :

        // Register blocks. Don't edit anything between the following comments.
        /* Pinegrow generated Register Blocks Begin */

        acf_register_block_type( array(
            'name' => 'test-blocks/acf-block-test',
            'title' => __( 'ACF Blocks Test #1', 'test_blocks' ),
            'icon' => 'smiley',
            'category' => 'custom-posts',
            'render_template' => 'blocks/acf-block-test/acf-block-test.php',
            'supports' => array('color' => array('background' => true,'text' => true,'gradients' => true,'link' => true,),'typography' => array('fontSize' => true,),'anchor' => true,'align' => true,'multiple' => false,'className' => false,),
            'base_url' => test_blocks_plugin_base_url(),
            'base_path' => test_blocks_plugin_base_path()
        ) );

    /* Pinegrow generated Register Blocks End */
    endif;
}

```

…and ACF Blocks do not work for me at all in my local installation. I have played around endlessly with the block settings, but everything looks fine (in terms of previewing the PHP and manually checking the file path in the generated plugin) whilst the HTML does not render in the backend editor nor the frontend.

My assumption was the render template is the likely cause, so I changed this line in the plugin code generated by Pinegrow:

```auto
'render_template' => plugin_dir_path( __FILE__ ) . 'blocks/acf-block-test/acf-block-test.php',

```

Which is in line with what I’ve used previously when working with ACF Blocks.

Immediately, no more issues. The block renders perfectly in Gutenberg and the frontend.

This is a very pressing issue for me. I’d greatly appreciate either a quick fix pushed out or someone explaining what I’m doing wrong for this to be required currently on my end.

* * *

Edit: adding this info as requested in the sticky thread:

- Which Operating System and version of the Operating system? **macOS Ventura 13.5.2**
- Running Pinegrow directly on the host system or in a Virtual Machine? **Host system**
- Pinegrow version number: **7.71**
- Hardware details: **M1 Pro 16" MacBook Pro, 32GB memory, 1TB storage**
- Do you have a Firewall and/or Anti Virus running in the background? **Only whatever is default for macOS**
- Do you have a Webserver running in the background? **Local by Flywheel, otherwise nothing**

---

<div class="post-metadata">

**Author:** ![Bryn](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/bryn/32/5487_2.png) [@Bryn](https://forum.pinegrow.com/u/Bryn)\
**Post date:** [September 21, 2023, 10:04am UTC](https://forum.pinegrow.com/t/acf-blocks-broken-for-me-simple-fix-required/8380/2 "2023-09-21T10:04:22Z")

</div>

This might make more sense as a solution. The templates also work fine if this is the render template:

```auto
'render_template' => test_blocks_plugin_base_path() . '/blocks/acf-block-test/acf-block-test.php',

```

So it could be that Pinegrow is not formatting the render template in a usable way. I.e. the path needs to be complete, and an opening “/” needs to be added to the front of the relative path bit. It is not there by default if you look at the OP.

---

<div class="post-metadata">

**Author:** ![matjaz](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/matjaz/32/5_2.png) [@matjaz](https://forum.pinegrow.com/u/matjaz)\
**Post date:** [September 22, 2023, 8:09am UTC](https://forum.pinegrow.com/t/acf-blocks-broken-for-me-simple-fix-required/8380/3 "2023-09-22T08:09:28Z")

</div>

Thanks @Bryn! I added the path prefix to the render\_template for ACF blocks. This will be out in the next release.

---

<div class="post-metadata">

**Author:** ![Bryn](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/bryn/32/5487_2.png) [@Bryn](https://forum.pinegrow.com/u/Bryn)\
**Post date:** [September 22, 2023, 2:15pm UTC](https://forum.pinegrow.com/t/acf-blocks-broken-for-me-simple-fix-required/8380/4 "2023-09-22T14:15:47Z")

</div>

Much appreciated @matjaz!

Don’t forget that `plugin_dir_path( __FILE__ )` works as a standalone prefix for the render template path currently provided, and that `test_blocks_plugin_base_path()` only works if a / exists at the start of /blocks/block-name/whatever.

---

<div class="post-metadata">

**Author:** ![matjaz](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/matjaz/32/5_2.png) [@matjaz](https://forum.pinegrow.com/u/matjaz)\
**Post date:** [September 29, 2023, 8:10am UTC](https://forum.pinegrow.com/t/acf-blocks-broken-for-me-simple-fix-required/8380/5 "2023-09-29T08:10:55Z")

</div>

@Bryn the update is now out. Please check it out and let me know if everything is ok: [Pinegrow Web Editor 7.7, 7.71 & 7.72- September 14, 2023 | Pinegrow Web Editor](https://docs.pinegrow.com/release_notes/pinegrow-web-editor-7-7/)

---

<div class="post-metadata">

**Author:** ![Bryn](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/bryn/32/5487_2.png) [@Bryn](https://forum.pinegrow.com/u/Bryn)\
**Post date:** [September 29, 2023, 9:46pm UTC](https://forum.pinegrow.com/t/acf-blocks-broken-for-me-simple-fix-required/8380/6 "2023-09-29T21:46:20Z")

</div>

Looks to be working now @matjaz. Thanks!
