• Resolved permanyer

    (@permanyer)


    When checking “Enable option to disable plugin per page/post” in the plugin settings i get the error “The editor has encountered an unexpected error.” in the backend when trying to edit a project (CPT). I run wp 5.2.4 with gutenberg 6.7

    The post cannot be edited.

    It also gives the js error: Cannot read property ‘lazy_load_responsive_images_disabled’ of undefined at functions.js?ver=5.2.4:formatted:7097

    Unclicking “Enable option to disable plugin per page/post” in the plugin settings removes this problem.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Florian Brinkmann

    (@florianbrinkmann)

    Hey @permanyer,

    thanks for opening the issue! Could you post a list with the plugins you have active besides Lazy Loader? Is there something that disabled REST API features or something like that?

    And, if possible: Could you disable the other plugins and check if it is working then?

    Best,
    Florian

    Plugin Author Florian Brinkmann

    (@florianbrinkmann)

    PS: tried to reproduce it, but it seems to work for me with Gutenberg plugin active.

    Thread Starter permanyer

    (@permanyer)

    Hi,

    I deactivated all the plugins except Lazy loader and the problem persisted, so it is something with the theme.

    The only way i found to avoid the problem is to comment the line ‘show_in_rest’ => true, when registering the custom post type (that is, deactivating gutenberg).

    So, if the post is registered without gutenberg, there is no error when editing this post together with the option “Enable option to disable plugin per page/post” of the lazy loader plugin.

    
    register_post_type('project', array(
            'label' => __('Projecte', 'threeten_admin'),
            'public' => true,
            'capability_type' => 'post',
            'map_meta_cap' => true,
            'rewrite' => array('slug' => 'project'),
            'query_var' => 'project',
           // 'show_in_rest' => true,
            'supports' => array('title', 'page-attributes', 'editor', 'thumbnail'),
            'labels' => get_custom_post_type_labels(__('Projecte', 'threeten_admin'),__('Projectes', 'threeten_admin')) 
        ));
    
    Plugin Author Florian Brinkmann

    (@florianbrinkmann)

    Hi,

    ah, seeing the code I think I might know what the issue is (had a similar issue one time). Could you try to add custom-fields to the supports array and check if it works then?

    Best,
    Florian

    Plugin Author Florian Brinkmann

    (@florianbrinkmann)

    Marking that as resolved because there was no feedback to last reply.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘The editor has encountered an unexpected error.’ is closed to new replies.