• Resolved ignazio_

    (@ignazio_)


    We have this query to show a list of posts:

    echo do_shortcode(‘[wpdm_category id=”cyber-security,privacy” operator=”AND” title=”1″ desc=”1″ toolbar=”1″ paging=”1″ order_by=”post_title” order=”asc” items_per_page=”20″ cols=1 colspad=1 colsphone=1]’);

    where we want to show posts belonging to 2 different categories with operator ‘AND’

    after installing the new version 3.1.28 we have found a bug in class.Query.php line 295:

    if(count($this->params[‘tax_query’]) <= 2 && !isset($this->params[‘tax_query’][‘relation’])) $this->params[‘tax_query’][‘relation’] = ‘OR’;

    in the previous version was:
    if(count($this->params[‘tax_query’]) <= 1 && isset($this->params[‘tax_query’][‘relation’])) unset($this->params[‘tax_query’][‘relation’]);

    this bug make all the post, from a category OR another, visible in the same list

    we fix it in this way, changing <=2 in >=2

    if(count($this->params[‘tax_query’]) >= 2 && !isset($this->params[‘tax_query’][‘relation’])) $this->params[‘tax_query’][‘relation’] = ‘OR’;

    and the list now show again all the post correctly.

    what do you thing about? thank you

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘maybe a bug in class.Query.php? version 3.1.28’ is closed to new replies.