• Hello, love the plugin, but after rolling out the latest version on two different sites, with different configurations, one a multisite and one a single WP site, we’ve have editors experiencing numerous problems after editing existing blocks in existing content (page content, and custom post types)

    Steps to repro:

    • open an existing page or cpt in the block editor
    • edit some text content
    • An error will appear on some other blocks *while editing* and not the block being edited – the error is not always the same – they consist of the following:

    “This block has encountered an error and cannot be previewed”

    Sometimes the blocks will edit correctly with no errors, but then the following error will appear for every image, after modifying unrelated blocks, and then updating and reloading the editor.

    “This block contains unexpected or invalid content”

    Here are the errors that appear in the Javascript console:

    Failed to load resource: the server responded with a status of 403 ()
    
    /wp-json/wp/v2/visibility_preset?context=edit&per_page=100&lang=en&is_block_editor=true&_locale=user
    
    // return data from ajax:
    {"code":"rest_forbidden_context","message":"Sorry, you are not allowed to edit posts in this post type.","data":{"status":401}}

    Also, in the console:

    TypeError: Cannot read properties of null (reading 'length')
        at kn (block-visibility-editor.js?ver=c3279e8a7d1af51827d4:39:4780)
        at St (react-dom.min.js?ver=18:1:47627)
        at yr (react-dom.min.js?ver=18:1:56442)
        at $s (react-dom.min.js?ver=18:1:121443)
        at Sl (react-dom.min.js?ver=18:1:88649)
        at kl (react-dom.min.js?ver=18:1:88577)
        at bl (react-dom.min.js?ver=18:1:88440)
        at sl (react-dom.min.js?ver=18:1:85264)
        at dl (react-dom.min.js?ver=18:1:85651)
        at Nn (react-dom.min.js?ver=18:1:32464)

    We utilize core capabilities to restrict access to these users, however the issue seems to be related directly to the new version of Block Visibility – this is determined by the fact that when I roll back the Block Visibility plugin to 3.0.4 (or disable it completely) the errors cease and cannot be reproduced anymore.

    Can you please review and let me know if you are able to recreate? If you need further detailed information regarding other plugins installed and environment, or access to a staging site to reproduce the error, can you please provide me an email address to contact you directly, as I am not authorized to publish those publicly.

    Thanks for your work on this great plugin, and your consideration to this pressing matter – in the meantime, we will be rolling back and ‘freezing’ the plugin updates to the previous version, until we can resolve these issues.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Nick Diego

    (@ndiego)

    Hi there,

    Thanks for reaching out and I apologize for the trouble. Can you provide me with more information about this:

    We utilize core capabilities to restrict access to these users…

    The error messages point to a permissions issue when trying to fetch presets. So, any additional info you can provide about how you are restricting access will help me set up a similar environment on my end for testing.

    I believe the issue is related to #77, but I would like to be able to confirm before implementing any changes.

    Thanks,
    Nick

    Plugin Author Nick Diego

    (@ndiego)

    Hi @earthman100,

    Just following up on my previous message.

    Thanks for reaching out and I apologize for the trouble. Can you provide me with more information about this:

    We utilize core capabilities to restrict access to these users…

    The error messages point to a permissions issue when trying to fetch presets. So, any additional info you can provide about how you are restricting access will help me set up a similar environment on my end for testing.

    I believe the issue is related to #77, but I would like to be able to confirm before implementing any changes.

    Thanks,
    Nick

    Thread Starter Earthman Media

    (@earthman100)

    Hi Nick,

    Apologies for the delayed reply

    In one of the sites that has this problem, we use PublishPress Capabilities Pro and Publishpress Permissions Pro plugins

    In the other site, we use Members with some capabilities restricted, and some custom code using the user_has_cap filter hook

    In both cases, the plugins and custom code use the WordPress core roles and Capabilities system to restrict access to custom post types and taxonomies.

    Hope this helps. If you need more specific information (code snippets etc), please feel free to reach out directly by email to earthman.ca

    Plugin Author Nick Diego

    (@ndiego)

    This is helpful, thanks. I will continue to run some test on my end and see if I can replicate for users with restricted capabilities.

    Best,
    Nick

    Plugin Author Nick Diego

    (@ndiego)

    Hi @earthman100,

    While I am still unable to replicate the issue, I did find a few other bugs in my investigation that might be causing it. I just published v3.1.2 fixing those.

    Whenever you have time, please give v3.1.2 a test and let me know if that resolved things. Sorry again for the trouble.

    Best,
    Nick

    Thread Starter Earthman Media

    (@earthman100)

    Heya @ndiego ,

    I appreciate you taking the time to look at this. From my initial testing, your changes appear to resolve the issues we were seeing. I’ll put this in front of my client’s testers and confirm, but so far it looks great.

    Thanks again!
    T

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Errors in block editor after latest update’ is closed to new replies.