mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
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
This commit is contained in:
parent
1576a83505
commit
b8714ede74
1 changed files with 6 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue