• Resolved cakidnyc

    (@cakidnyc)


    Hi, We have a page that has been working fine for many years. After upgrading Search Exclude to 2.1.8, the page stops returning results. I upgraded WordPress to 6.7.1 and tried Search Exclude 2.2.0, but it still doesn’t work and there are no errors. When I downgrade Search Exclude to 2.1.7, then it works fine (still w/ WP 6.7.1).

    This is the query that is no longer returning posts after 2.1.7:

    global $wp_query;
    $wp_query = new WP_Query(array(
    'post_type' => array('post', 'video', 'rl_gallery'),
    'post_status' => 'publish',
    'fields' => 'ids',
    'number' => $page_size,
    'offset' => ($paged-1) * $page_size,
    'orderby' => 'date',
    'order' => 'DESC',
    'tax_query' => array(
    'relation' => 'OR',
    array(
    'taxonomy' => 'category_common',
    'field' => 'term_id',
    'terms' => array(CAT_COMMON_TOPIC_PAGE, CAT_COMMON_TOP_NEWS_VIDEO),
    ),
    array(
    'taxonomy' => 'category',
    'field' => 'term_id',
    'terms' => array(CAT_NEWS, CAT_NEWS_IN_THE_NEWS, CAT_NEWS_PRESS_RELEASES),
    ),
    array(
    'taxonomy' => 'rl_category',
    'field' => 'term_id',
    'terms' => array(RL_CATEGORY_FALUN_GONG),
    ),
    ),
    ));

    The end result is that have_posts() is false.

    I do know that the problem has something to do with the ‘tax_query’ because if I comment that out, then the query at least returns posts. I didn’t build this site, so I don’t know the details, but it seems those taxonomies (e.g. ‘category_common’) are created using the Pods – Custom Content Types and Fields plugin. The constants like ‘CAT_NEWS’ are just category id’s.

    Any ideas on what changed from v2.1.7 to v2.1.8 that might be causing this problem?

    Thanks!

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support jmatiasmastro

    (@jmatiasmastro)

    @cakidnyc

    Hi mate,

    Most users have confirmed that the issue was resolved with version 2.2.0. However, since you’re still experiencing the problem on your specific WordPress installation, we recommend submitting a support ticket through the following link: https://urbiport1.atlassian.net/servicedesk/customer/portal/2.

    This will allow us to investigate further. It’s possible that the issue is related to a particular configuration in your theme, plugins, or WordPress setup.

    Best regards, Quadlayers Support Team.

    codewisenicolas

    (@codewisenicolas)

    Ive tracked down the problem in the plugin that causes posts to not show up.

    Its due to a programming error around line 62-105 of class-frontend.php.
    The code re-uses the $tax_query variable and thus if the original query has a taxonomy query even if there is no search exclusions, the code will run and merge the variable into itself causing the WP Query to be wrong.
    That whole function needs to be debugged and properly re-written to account for queries from the system that have tax_query in them when there is no taxnomy exclusions from search.

    For now, change line 62 so its an empty array and not the original tax_query
    $tax_query = array(); //$query->get( 'tax_query', array() );

    @jmatiasmastro see my previous message for problem and solution.

    Thread Starter cakidnyc

    (@cakidnyc)

    Just updated to v2.3.0 and now the problem is gone.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.