• Hello,

    First, I would like to thank you for this great plugin. This is by far the best solution to embed code on a WordPress site!

    I would like to report that there is a Missing Style Dependency: prismatic-blocks on front-end when using the “Disable the Prismatic block stylesheet on the frontend” setting.

    This notice occurs when using the Query Monitor plugin. See screenshot: https://i.imgur.com/8dWMW4D.jpg

    Note: I’m using Classic Editor.

    There is no notice in PHP logs, but I guess this could be optimized ??

    Have a nice day!

    Regards.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Jeff Starr

    (@specialk)

    Thanks for the great feedback, it is appreciated.

    So for the dependency error, are you using the default theme?

    Thread Starter Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Sorry should have mention my settings. Yep, Default Theme.

    Screenshots of the settings: https://imgur.com/a/hegbTIK

    Regards.

    Plugin Author Jeff Starr

    (@specialk)

    Thanks.

    I will test with the latest default theme, Twenty Twenty One, and see if there is anything that can be done. I’m thinking at this point that, if the styles are required by the theme (any theme), then you will want to keep the “Disable the Prismatic block stylesheet” setting unchecked.

    Not sure though, will take a closer look for the next update.

    Thread Starter Konrad Chmielewski

    (@hwk-fr)

    Oh okay, you meant WordPress theme! I’m using a custom theme.

    I’ve dig up a bit, and it looks like the problem come from the register_block_type() in /inc/prismatic-blocks.php:39.

    When using the “Disable the Prismatic block stylesheet on the frontend” setting, it deregister the style, but after that, the block type cannot correctly retrieve the prismatic-blocks style handle. This is what trigger the notice.

    I had a similar problem in the past. A way to deregister a style without breaking dependencies is to deregister the style, and then re-register it without any path.

    In short here is a fix that works:

    In the file /inc/prismatic-core.php:231:

    if ($disable) {
        
        wp_deregister_style('prismatic-blocks');
        
        // Fix handle for block type
        wp_register_style('prismatic-blocks', false);
        
    }
    

    Boom! The block type no longer throw a notice, since the handle exists, but it still won’t enqueue anything.

    Have a nice day!

    Regards.

    Plugin Author Jeff Starr

    (@specialk)

    Brilliant, thank you for the help Konrad. I will verify and implement this solution in the next plugin update. Cheers!

    Thread Starter Konrad Chmielewski

    (@hwk-fr)

    Keep it up!

    Regards.

    Plugin Author Jeff Starr

    (@specialk)

    Just to follow up with this, your solution is implemented in the next version of the plugin (v2.7). Should be available today or tomorrow. Thanks again for the help with this, Konrad.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Missing Style Dependency “primatic-blocks”’ is closed to new replies.