ZF-10884: Zend_Paginator - Row count column not found
When using custom $rowCount as shown on example in manual:
$row_count->from( array('table_name'), array( Zend_Paginator_Adapter_DbSelect::ROW_COUNT_COLUMN => new Zend_Db_Expr('COUNT(DISTINCT id)') ) );
it throws 'Row count column not found' exception, because there is wrong checking for ROW_COUNT_COLUMN when using 'AS_field' => 'db_expr'. Current assigment:
$columns = $rowCount->getPart(Zend_Db_Select::COLUMNS); $countColumnPart = $columns;
is not aware of 'AS' part, which is stored in $columns, and throws exception.
Possible solution is to check whether $columns field is present or not, and use it as $countColumnPart when it's present.