[Akelos PHP Framework] #61: cant sort by pagination_helper with include option

1 view
Skip to first unread message

Akelos PHP Framework

unread,
Sep 14, 2007, 1:37:55 AM9/14/07
to
#61: cant sort by pagination_helper with include option
---------------------+------------------------------------------------------
Reporter: bobchin | Type: defect
Status: new | Priority: major
Milestone: 0.8 | Component: Action View
Keywords: |
---------------------+------------------------------------------------------
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));

}
}}}

--
Ticket URL: <http://trac.akelos.org/ticket/61>
Akelos PHP Framework <http://www.akelos.org/>
Akelos PHP Framework

Akelos PHP Framework

unread,
Sep 14, 2007, 6:22:00 PM9/14/07
to
#61: cant sort by pagination_helper with include option
-------------------------+--------------------------------------------------
Reporter: bobchin | Owner: bermi
Type: defect | Status: assigned
Priority: major | Milestone: 0.9
Component: Action View | Resolution:
Keywords: |
-------------------------+--------------------------------------------------
Changes (by bermi):

* owner: => bermi
* status: new => assigned
* milestone: 0.8 => 0.9

Comment:

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

Its a great chance to implement a PaginationHelperTestCase.

--
Ticket URL: <http://trac.akelos.org/ticket/61#comment:1>

Akelos PHP Framework

unread,
Dec 1, 2008, 3:56:34 AM12/1/08
to
#61: cant sort by pagination_helper with include option
-------------------------+--------------------------------------------------
Reporter: bobchin | Owner: bermi
Type: defect | Status: assigned
Priority: major | Milestone: 0.9
Component: Action View | Resolution:
Keywords: |
-------------------------+--------------------------------------------------
Comment (by dpinte):

I have just tested the patch on my application and got the following error
:

Fatal error: Maximum function nesting level of '100' reached, aborting! in
/home/did/projets/admst/admdb/beta/akelos/lib/AkBaseModel.php on line 2709

I think there is some recursive call on the getAvailableAssociates() of
AkAssociatedActiveRecord.php

I would be very interested in a working version of the patch ;-) I have no
time to investigate but I will try to do it.

--
Ticket URL: <http://trac.akelos.org/ticket/61#comment:2>

Akelos PHP Framework

unread,
Dec 20, 2009, 7:16:48 AM12/20/09
to
#61: cant sort by pagination_helper with include option
-------------------------+--------------------------------------------------
Reporter: bobchin | Owner:
Type: defect | Status: new
Priority: major | Milestone: 2.0
Component: Action View | Resolution:
Keywords: |
-------------------------+--------------------------------------------------
Changes (by bermi):

* owner: bermi =>
* status: assigned => new
* milestone: 1.0.1 => 2.0

Comment:

Akelos Paginator will only support one level finders at this point. After
hitting myself with this issue on several projects, most of the solutions
in order to be efficient required custom techniques, like getting the ids
in the right order for pagination, and using the paginator using just a
simple list of ID's.

There might be a proper solution for all, once we refactor the Active
Record itself into smaller pieces and replace pear Pager.

Moving to 2.0

--
Ticket URL: <http://trac.akelos.org/ticket/61#comment:3>
Reply all
Reply to author
Forward
0 new messages