Ticket #120: fix-incorrect-translation-lists.diff

File fix-incorrect-translation-lists.diff, 1.1 KB (added by Nightgunner5, 22 months ago)
  • translation.php

     
    117117                } 
    118118                if ( $all_in ) { 
    119119                        $statuses_where = array(); 
     120 
     121                        if ( !in_array( gp_array_get( $filters, 'translated' ), array( 'yes', 'no' ) ) ) 
     122                                $statuses_where[] = 't.status IS NULL'; 
     123 
    120124                        foreach( $statuses as $single_status ) { 
    121125                                $statuses_where[] = $gpdb->prepare( 't.status = %s', $single_status ); 
    122126                        } 
    123127                        $statuses_where = '(' . implode( ' OR ', $statuses_where ) . ')'; 
    124                         $join_where[] = $statuses_where; 
    125                         /* 
    126                                 usually we want the status to be part of the ON clause, because we want to include 
    127                                 the untranslated strings in the listing. This, however is not the case if the filter 
    128                                 explictly forbids untranslated strings 
    129                         */ 
    130                         if ( 'no' == gp_array_get( $filters, 'translated' ) ) { 
     128 
     129                        if ( 'no' == gp_array_get( $filters, 'translated' ) ) 
     130                                $join_where[] = $statuses_where; 
     131                        else 
    131132                                $where[] = $statuses_where; 
    132                         } 
    133133                } 
    134134                 
    135135                $where = implode( ' AND ', $where );