Support

Account

Home Forums Gutenberg Your site doesn’t include support for the "acf/block-name" block.

Solving

Your site doesn’t include support for the "acf/block-name" block.

  • After updating today ACF Pro from Version 5.9.7 to 5.9.8 (WordPress Version 5.7.2 / PHP 7.4.21), all my ACF-Blocks don’t show up anymore and display instead this message:
    Your site doesn’t include support for the “acf/block-name” block.

    When i revert back to ACF Pro Version 5.9.7 it works as expected. Are there any changes in the last update?

    • jonschr

    • July 13, 2021 at 12:57 pm

    Exactly the same behavior here. Just dropping a note in here to watch the topic. This is the plugin registering the “Section” block that I’m seeing not work properly in 5.9.8, if you need something to replicate the behavior without having to set up any fields manually:

    https://github.com/jonschr/elodin-section-block

  • Thanks so much for pointing me in the right direction, @lgladdy, and my apologies for hijacking the thread, @hellmute; I thought for sure this was the same issue happening!

    For anyone else reading this, an important point that got me confused earlier – ANY plugin that does this incorrectly (as mine all did) can break the site for ALL ACF blocks on the backend. That means if you have multiple plugins that are including ACF, then you’ll need to add a conditional for each of those or have the plugin author do that.

  • Hey @hellmute

    Could you drop us an email to support@advancedcustomfields.com with your block configuration and template file please?

    In the mean time, I’ll see if I can reproduce this with your elodin-section-block repo @jonschr

  • Hey @jonschr, ACF 5.9.8 changed most of the asset paths, so the issue with your section plugin is a conflict between the bundled ACF 5.9.3 and the installed ACF 5.9.8.

    Because you filter acf/settings/url to your path, that’s being applied to the installed 5.9.8 too, which is then trying to load 5.9.3 assets. This is likely to break a lot of things regardless, as even on 5.9.7 you’d have been loading 5.9.3 assets.

    You should probably detect if ACF is already installed and active and not modify the assets URL if it is.

  • So, I think that explanation makes perfect sense – however, even if I comment out the part of the plugin that includes the other version of ACF, then delete the /vendor/acf folder in the plugin (ensuring that only the live version, 5.9.8, is loading), I’m still seeing the issue, so I think it must be something else causing this.

    I’d thought that ACF internally already checked if another instance was loaded and ensured that there’s only one version being loaded, no? https://support.advancedcustomfields.com/forums/topic/check-acf-exists-or-not/

  • Oops. I’m an idiot. I have at LEAST one other plugin that uses the same methodology installed on this site. I need to make the update to ALL of those plugins. I’ll try that first; no need to look at this again yet.

  • @jonschr Hey Jon, you’re right that ACF prevents itself from loading, but your call to the change the setting URL is being read by the “normal” install of ACF, and trying to load the assets from your included plugin as that is still set.

    Your best bet would be to copy that detection logic into your plugin, then place the whole include and add_filter inside it.

  • Like this? (This is what I did on the three plugins I thought of that would be affected, and this seems to work).

    
    
    /////////////////
    // INCLUDE ACF //
    /////////////////
    
    // Define path and URL to the ACF plugin.
    define( 'ELODIN_SECTION_BLOCK_ACF_PATH', plugin_dir_path( __FILE__ ) . 'vendor/acf/' );
    define( 'ELODIN_SECTION_BLOCK_ACF_URL', plugin_dir_url( __FILE__ ) . 'vendor/acf/' );
    
    if( !class_exists('ACF') ) {
        
        // Include the ACF plugin.
        include_once( ELODIN_SECTION_BLOCK_ACF_PATH . 'acf.php' );
    
        // Customize the url setting to fix incorrect asset URLs.
        add_filter('acf/settings/url', 'elodin_sections_block_acf_settings_url');
        
    }
    
    function elodin_sections_block_acf_settings_url( $url ) {
        return ELODIN_SECTION_BLOCK_ACF_URL;
    }
    
  • @jonschr Yup! That seems great 🙂

    And just for anyone else reading this thread, @hellmute‘s issue seems to be different. I’ll update back here once we have a cause and resolution there too 🙂

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.