Editor.php _ssp_query bug

Editor.php _ssp_query bug

choovickchoovick Posts: 3Questions: 0Answers: 0

Another one in Editor-1.3.1-trial.zip package

When applying where clause on server side got a fatal error in the following condition:

line 778: if ( count( $this->_where ) ) { // only needed if there is a where condition
            $this->_left_join( $ssp_set_count );
        }

$ssp_set_count at this point no longer query object due to earlier overwrite:

line 770:
$ssp_set_count = $ssp_set_count->exec()->fetch();

my fix:

// Get the number of rows in the result set
        $ssp_set_count_query = $this->_db
            ->query('select')
            ->table( $this->_table )
            ->get( 'COUNT('.$this->_pkey.') as cnt' );
        $this->_get_where( $ssp_set_count_query );
        $this->_ssp_filter( $ssp_set_count_query, $http );
        $this->_left_join( $ssp_set_count_query );
        $ssp_set_count = $ssp_set_count_query->exec()->fetch();

        // Get the number of rows in the full set
        $ssp_full_count = $this->_db
            ->query('select')
            ->table( $this->_table )
            ->get( 'COUNT('.$this->_pkey.') as cnt' );
        $this->_get_where( $ssp_full_count );
        if ( count( $this->_where ) ) { // only needed if there is a where condition
            $this->_left_join( $ssp_set_count_query );
        }

BR,
Alex

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Nice catch. I'll get that fix merged in as well :-)

    Allan

This discussion has been closed.