• Resolved franga2000

    (@franga2000)


    Hi!

    I’m running version 5.3.5 of Modern Events Calendar Lite and it is breaking the /v2/search REST endpoint, which manifests itself primarily as no other post types other than events showing up in the link creation search box in Gutenberg.

    Steps to reproduce

    1. Make a new post/page using Gutenberg, select some text and press “Link”
    2. Type in the title of an existing post/page

    Nothing appears (besides any MEC events that happen to match the keywords)

    Repeat the above after disabling Modern Event Calendar Lite and your posts, pages and everything else will apperar again.

    Cause

    On line 242 of plugin file ./app/features/search.php a check is made to determine whether to take over a search query. If the post_type array contains mec-events, the query is rewritten and on line 304, limited to only the mec-events post type.

    The problem with this is that the post_type array may have contained other post types that should have been searched, but were removed by the function. This is the case with the Gutenberg search box, as it is designed to search all post types, which includes mec-events.

    Proposed fix

    I updated the aforementioned condition to not only check if mec-events is present in the post_types array, but also that it is the only one (array length is at most 1). This fixes the issue.

    
    if((is_array($query->get('post_type')) and (!in_array('mec-events', $query->get('post_type')) or count($query->get('post_type')) > 1)) or (!is_array($query->get('post_type')) and $query->get('post_type') != 'mec-events')) return $query;
    

    Note

    I have not tested whether my fix breaks any aspect of event searching/filtering, as I do not use those features.

    I would also like to ask you to notify me when a fix for this issue lands, as I will be avoiding updating the plugin until then to prevent my hotfix from being undone.

Viewing 10 replies - 1 through 10 (of 10 total)
  • I can confirm this Error! I Use WpBakery and the standard editors in WP as well, so i can confirm that MEC causes the Error:

    breaking the /v2/search REST endpoint, which manifests itself primarily as no other post types other than events showing up in the link creation search box in Gutenberg.

    As i’m not a programmer i don’t like to play around with the Code directly, so waiting for the Fix of this issue… I Try to do a rollback to tha latest version which was working for me!

    Plugin Contributor webnus

    (@webnus)

    Hi All,

    Thank you for contacting us,

    This is forwarded to the developer team and it will be fixed for the next updates, but it takes time to be fixed.

    Thank you for your reports.

    Best Regards

    “need time do be fixed”, serious? What does that mean as this is an important function in WP for me and i think for others as well…

    Plugin Contributor webnus

    (@webnus)

    Hi @leogc,

    We referred this to the relevant team and assure you that will fix it in the next update. The update will be out in a few days.

    Stay safe.

    Good! Until then i have roll backed the Plug In. To have a full functionality of my administration area.

    assure you that will fix it in the next update

    @webnus so with Update to Version 5.4 this BUG is still alive, just to let you know, this means with the “next update” it is not fixed.

    Plugin Contributor webnus

    (@webnus)

    Hi @leogc,

    I intended to inform you that the issue is resolved. When we received your message we began to examine this in detail both before and after 5.4.0 update. The issue reported by @franga2000 in their first reply is fixed and we didn’t see anything else in the Block Editor; as can be seen in the changelog.

    Can you please tell us what is your theme and other active plugins?
    Have you tried disabling them to see if they are causing conflicts?
    Please set the theme to default and deactivate all the plugins, including MEC. Then, activate MEC, then the theme, and then the other plugins one by one. With every activation check to see if the issue occurs. Then tell us how the issue occurs so that we can replicate it.

    Please keep me posted,

    Best Regards

    @franga2000 fixed the problem with programming skills by his own, not with the Update, Of i deactivae ALL plugins and let MEC active the Problem is still there. If i deactivate MEC the problem is gone.

    Are you think that i am that stupid? Because this is always the first thing i do, to see which Plug in Causes problems, and IT IS MEC (again…)

    So this is still NOT SOLVED

    I can confirm this Error! I Use WpBakery and the standard editors in WP as well, so i can confirm that MEC causes the Error:

    breaking the /v2/search REST endpoint, which manifests itself primarily as no other post types other than events showing up in the link creation search box in Gutenberg.

    As i’m not a programmer i don’t like to play around with the Code directly, so waiting for the Fix of this issue… I Try to do a rollback to tha latest version which was working for me!

    This only Happens in the area were i created the Blogpostings, in Sitecreation it works fine. So for Me Version 5.4 is still not working correctly. So i use still Version 5.3 until this problem is really solved.

    I will open an NEw treat, so explain a bt better with screenshots. So that the issue is not solved for me.

    Plugin Contributor webnus

    (@webnus)

    Hi @leogc,

    We received your topic, and it will be fixed as soon as possible, however for clarifying we fixed this issue on this topic on block editor, but you reported on a new topic, about the classic editor and these information were not given to us here. However, we forwarded your issue to the developer to fix it in the next updates.

    Thank you for your reports.

    Best Regards

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[BUG] Plugin breaks REST search’ is closed to new replies.