• Resolved Frumph

    (@frumph)


    file: lib/tribe-event-query.class.php

    Bad code:

    // include events in search results
    			if ( $query->is_search && $query->get( 'post_type' ) == '' ) {
    				$query->set( 'post_type', 'any' );
    			}

    the $query->set ‘any’ is not applicable in all instances where post_type == ” especially when other things are adding to it which results in regular ‘post’ post type is not being found, commenting out this code makes them work again for everyone else…

    Using this in the register_taxonomy *should* be all you need instead of that.
    'query_var' => true

    https://www.ads-software.com/plugins/the-events-calendar/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Howdy Frumph,

    Thank you for taking the time to document this! I will pass it along to our devs and they can review implementing it.

    While I can not speak to these three lines, I know that we have found plenty of times where doing all you “should” need to do means that you end up conflicting with some major themes or plugins. So, we have to find work arounds. It is possible that this code is just such a work around.

    Thanks again, we really appreciate assistance in polishing off The Events Calendar.

    – Brook

    Hello again Frumph,

    We have looked into this a bit further. We definitely feel like setting the post_type to any is not a perfect solution, and are interested in changing that to be more specific. However, your proposed solution will unfortunately not work for the variety of environments and situations our plugin is used in.

    Would you mind letting us know what specific problem are you facing? Do you have other custom post_types that you wanted excluded from search results? Is that how you discovered this bug? If we have specifics then we can better understand if our solution is going to work for people in your circumstance. And if anyone else comes across this and has found it to be a difficulty, please chime in about what your are trying to do and why this affects it. Thanks!

    – Brook

    Thread Starter Frumph

    (@frumph)

    The way you should do it, is get the the array of post_type and ADD yours to it, not replace it – don’t set it to ‘any’; putting any nulls out any other and all other custom post types that are associated

    The problem is that when something is ” it really isn’t ” it’s reading off the base of possible post types to search from from internal values; changing that negates those

    > The way you should do it, is get the the array of post_type and ADD yours to it, not replace it – don’t set it to ‘any’; putting any nulls out any other and all other custom post types that are associated

    Agreed 100%. That is what we are looking into doing. I appreciate your feedback.

    > The problem is that when something is ” it really isn’t ” it’s reading off the base of possible post types to search from from internal values; changing that negates those

    I am not sure I understand this. If you are basically explaining that in setting the post_type to any we are going to include post_types that are not supposed to be included, then again we completely agree. I am glad you pointed this out. We can now find a solution for a future version. Thanks!

    – Brook

    Plugin Contributor leahkoerper

    (@leahkoerper)

    Hi there,

    I just wanted to update you here. We were not able to fix this issue in time for our upcoming release (3.6). However, it is still very much a priority and we plan to work on it for a future maintenance release. We will keep you posted on our progress. Thank you for your patience and support!

    Best,
    Leah

    Plugin Contributor leahkoerper

    (@leahkoerper)

    Hi there,

    I just wanted to let you know that we were able to work on this issue for our upcoming 3.8 release. Keep an eye out on your site for an update announcement! If you update and are still seeing this problem, please post a new thread so we can check it out. Thank you for your patience while we got this fix in place.

    Best,
    Leah
    and the team at Modern Tribe

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Bug report: bad code in lib/query’ is closed to new replies.