• Resolved Ito Kosuke

    (@ispheare)


    CoBlocks v3.1.0 with WordPress v6.0.5 raises error below.

    Fatal error: Uncaught TypeError: strpos(): Argument #1 ($haystack) must be of type string, array given in wp-includes/blocks.php:20
    
    Stack trace:
    #0 wp-includes/blocks.php(20): strpos(Array, 'file:')
    #1 wp-includes/blocks.php(84): remove_block_asset_path_prefix(Array)
    #2 wp-includes/blocks.php(316): register_block_script_handle(Array, 'editorScript')
    #3 wp-includes/blocks.php(391): register_block_type_from_metadata('...', Array)
    #4 wp-content/plugins/coblocks/includes/class-coblocks-register-blocks.php(189): register_block_type('...', Array)
    #5 wp-includes/class-wp-hook.php(307): CoBlocks_Register_Blocks->register_blocks('')
    #6 wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array)
    #7 wp-includes/plugin.php(476): WP_Hook->do_action(Array)
    #8 wp-settings.php(598): do_action('init')
    #9 wp-config.php(100): require_once('...')
    #10 wp-load.php(50): require_once('...')
    #11 wp-blog-header.php(13): require_once('...')
    #12 index.php(17): require('...')
    #13 {main}
    
    thrown in wp-includes/blocks.php on line 20

    WordPress v6.0.5 does not support array value for editorScript in block.json. It’s supported from WordPress v6.1.

    WordPress v6.0’s register_block_script_handle() https://github.com/WordPress/WordPress/blob/6.0-branch/wp-includes/blocks.php#L83
    WordPress v6.1’s register_block_script_handle() https://github.com/WordPress/WordPress/blob/6.1-branch/wp-includes/blocks.php#L98

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Anthony Ledesma

    (@paranoia1906)

    Hi @ispheare,

    Thank you for bringing the backward compatibility issue to our attention. It has become clear to us that we have not been updating the minimum supported WordPress version as required. We will be pushing out a patch release of CoBlocks that updates the minimum supported version to 6.2.

    Unfortunately, CoBlocks has changed to the point where further backward compatibility will not be feasible. If continued backward compatibility is required, you may need to run older versions of CoBlocks.

    Best regards,

    Anthony

    Thread Starter Ito Kosuke

    (@ispheare)

    Thank you for your reply.

    If you leave it as it is, it will be distributed to unsupported WordPress environments. You should drop the current version and set the Requires at least header to the plugin.

    Plugin Author Anthony Ledesma

    (@paranoia1906)

    @ispheare CoBlocks version 3.1.1 is now released. The hotfix updates the supported version. That should resolve the issue of incompatible distribution with previous WordPress versions. Thanks again for the contribution and for taking the time to make this thread and provide information.

    Best,

    Anthony

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Compatibility with WordPress 6.0 and earlier is broken.’ is closed to new replies.