diff --git a/changelog.md b/changelog.md index 9652e9a5..e1c0dc35 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,13 @@ # Laravel Change Log +## Version 2.0.5 + +- Fix: Remove orderings before running pagination queries. + +### Upgrading from 2.0.4 + +- Replace **laravel** directory. + ## Version 2.0.4 - Feature: Added default parameter to File::get method. diff --git a/laravel/database/query.php b/laravel/database/query.php index 7adac35e..76928792 100644 --- a/laravel/database/query.php +++ b/laravel/database/query.php @@ -531,11 +531,16 @@ private function aggregate($aggregator, $column) */ public function paginate($per_page = 20, $columns = array('*')) { - // Calculate the current page for the request. The page number - // will be validated and adjusted by the Paginator class, - // so we can assume it is valid. + // Because some database engines may throw errors if we leave + // orderings on the query when retrieving the total number + // of records, we will remove all of the ordreings and put + // them back on the query after we have the count. + list($orderings, $this->orderings) = array($this->orderings, null); + $page = Paginator::page($total = $this->count(), $per_page); + $this->orderings = $orderings; + return Paginator::make($this->for_page($page, $per_page)->get($columns), $total, $per_page); } diff --git a/public/index.php b/public/index.php index b793f669..68fb73bc 100644 --- a/public/index.php +++ b/public/index.php @@ -3,7 +3,7 @@ * Laravel - A PHP Framework For Web Artisans * * @package Laravel - * @version 2.0.4 + * @version 2.0.5 * @author Taylor Otwell * @link http://laravel.com */