From b8714ede74549dc7e00f45fd0ff22ac1e977a6bc Mon Sep 17 00:00:00 2001 From: gwoo Date: Fri, 27 Jun 2008 03:12:45 +0000 Subject: [PATCH] fix to paginate sort order for self associated models git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7278 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/libs/controller/controller.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cake/libs/controller/controller.php b/cake/libs/controller/controller.php index ca4531abd..25ced4096 100644 --- a/cake/libs/controller/controller.php +++ b/cake/libs/controller/controller.php @@ -683,7 +683,7 @@ class Controller extends Object { * @param string $action Action name to render * @param string $layout Layout to use * @param string $file File to use for rendering - * @return boolean Success + * @return string Full output string of view contents * @access public */ function render($action = null, $layout = null, $file = null) { @@ -923,10 +923,12 @@ class Controller extends Object { if (strpos($key, '.') !== false) { $field = array_pop(explode('.', $key)); } + + $value = $options['order'][$key]; + unset($options['order'][$key]); + if ($object->hasField($field)) { - $options['order'][$object->alias . '.' . $field] = $options['order'][$key]; - } else { - unset($options['order'][$key]); + $options['order'][$object->alias . '.' . $field] = $value; } }