Ticket #163: 163.diff

File 163.diff, 1.2 KB (added by nacin, 14 months ago)
  • gp-includes/thing.php

     
    372372         
    373373        function fields() { 
    374374                $result = array(); 
    375                 foreach( $this->field_names as $field_name ) { 
     375                foreach( array_merge( $this->field_names, $this->non_db_field_names ) as $field_name ) { 
    376376                        if ( isset( $this->$field_name ) ) { 
    377377                                $result[$field_name] = $this->$field_name; 
    378378                        } 
     
    402402                if ( $conditions_str ) $conditions[] = $conditions_str; 
    403403                return implode( ' AND ', $conditions ); 
    404404        } 
    405 } 
    406  No newline at end of file 
     405} 
  • gp-includes/things/translation-set.php

     
    33 
    44        var $table_basename = 'translation_sets'; 
    55        var $field_names = array( 'id', 'name', 'slug', 'project_id', 'locale' ); 
     6        var $non_db_field_names = array( 'current_count', 'untranslated_count', 'waiting_count' ); 
    67        var $non_updatable_attributes = array( 'id' ); 
    78 
    89        function restrict_fields( $set ) {