Ticket #61 (assigned defect)

Opened 1 year ago

Last modified 1 year ago

cant sort by pagination_helper with include option

Reported by: bobchin Assigned to: bermi (accepted)
Priority: major Milestone: 0.9
Component: Action View Keywords:
Cc:

Description

using pagination_helper with include option, search for including model's column. at that time in PaginationHelper::_getOrderFromAssociations() uses AkActiveRecord::getAvailableAssociates(), it dones not implement.

and maybe it seems to have some problems. I make patches.

My environment is: WinXp?, Xampp1.5.5 apache2.2.3,PostgreSQL8.2, PHP5.2.0

Model: User

$this->createTable('users', "
  id,
  name text,
  kana text,
  login text,
  number text,
  email text,
  mobile text,
  enabled integer,
  user_type_id,
  created_at,
  updated_at
");

class User extends ActiveRecord
{
    var $belongsTo = 'user_type';
}

UserType:

{{{
$this->createTable('user_types', "
  id,
  name text,
  created_at,
  updated_at
");

}}}

user_controller:

    function listing()
    {
        $this->user_pages = $this->pagination_helper->getPaginator(
            $this->User, 
            array(
                'items_per_page' => 10,
                'include' => array('user_type'),
            )
        );
        $this->users = $this->User->find('all', $this->pagination_helper->getFindOptions($this->User));
        
    }

Attachments

pagination_helper.php.patch (2.8 kB) - added by bobchin on 09/14/07 00:38:15.
AkAssociatedActiveRecord.php.patch (0.7 kB) - added by bobchin on 09/14/07 00:38:34.
AkBelongsTo.php.patch (0.5 kB) - added by bobchin on 09/14/07 00:38:53.
AkHasOne.php.patch (0.5 kB) - added by bobchin on 09/14/07 00:39:11.

Change History

09/14/07 00:38:15 changed by bobchin

  • attachment pagination_helper.php.patch added.

09/14/07 00:38:34 changed by bobchin

  • attachment AkAssociatedActiveRecord.php.patch added.

09/14/07 00:38:53 changed by bobchin

  • attachment AkBelongsTo.php.patch added.

09/14/07 00:39:11 changed by bobchin

  • attachment AkHasOne.php.patch added.

09/14/07 17:21:55 changed by bermi

  • owner set to bermi.
  • status changed from new to assigned.
  • milestone changed from 0.8 to 0.9.

I will need some unit tests for this one in order to reproduce the bug.

Its a great chance to implement a PaginationHelperTestCase?.