• Error loading block: Invalid parameter(s): attributes

    I get this error when I try to insert a flex block into Gutenberg.
    Tried uninstalling and reinstalling.

    Any help would be appreciated.
    Wallace

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter wshealy

    (@wshealy)

    This seems to be a conflict with Gutenberg Blocks and Template Library by Otter

    Plugin Author Tajam

    (@tajam)

    Thanks for your report. We will try to investigate this issue, but have you also tried contacting the developer of Otter plugin about this? Because other plugin like WooCommerce blocks also has the same error when the Otter plugin is active.

    Brian Henry

    (@brianhenryie)

    Brian Henry

    (@brianhenryie)

    Here’s a fix:

    
    /**
     * Add the "Blocks CSS: CSS Editor for Gutenberg Blocks" plugin attributes to the Flex Posts attributes so the WordPress
     * REST API schema validates.
     *
     * @hooked flex_posts_attributes
    
     * @see https://www.ads-software.com/plugins/blocks-css/
     * @see flex_posts_register_block() block.php:31
     * @see register_block_type()
     *
     * @param  array    $attributes The validation schema as registered with register_block_type().
     * @return array    $attributes
     */
    add_filter( 'flex_posts_attributes', function( $attributes ) {
    
    	include_once ABSPATH . 'wp-admin/includes/plugin.php';
    	if( is_plugin_active( 'blocks-css/blocks-css.php' ) ) {
    
    		$attributes['hasCustomCSS'] = array(
    			'type'    => 'boolean',
    			'default' => false,
    		);
    		$attributes['customCSS']    = array(
    			'type'    => 'string',
    			'default' => '',
    		);
    
    	}
    
    	return $attributes;
    });
    

    …and I’ve created a PR to fix it for all plugins:
    https://github.com/Codeinwp/blocks-css/pull/5

    Plugin Author Tajam

    (@tajam)

    @brianhenryie Thanks a lot for your help in this issue. We really appreciate it.

    Plugin Author Tajam

    (@tajam)

    @wshealy for the “Gutenberg Blocks and Template Library by Otter” plugin, you can use the code above by @brianhenryie, but change the plugin check line:

    if ( is_plugin_active( 'blocks-css/blocks-css.php' ) ) {

    with this:

    if ( is_plugin_active( 'otter-blocks/otter-blocks.php' ) ) {

    • This reply was modified 5 years ago by Tajam.

    Same Error “Error loading block: Invalid parameter(s): attributes” in Block Editor when “Essential Blocks for Gutenberg” (https://www.ads-software.com/plugins/essential-blocks/) is active.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Error loading block: Invalid parameter(s): attributes’ is closed to new replies.