Bug #36575
Relation listSome does not respect limit settings (missing setLimit in Repository)
| Status: | New | Start date: | 2012-04-25 | |
|---|---|---|---|---|
| Priority: | Should have | Due date: | ||
| Assignee: | - | % Done: | 0% |
|
| Category: | important tasks | |||
| Target version: | First TER version | |||
| Votes: | 0 |
Description
First one remark: hopefully next week i will find some time to setup gerrit that i can commit patches on my own ...
to solve this
Just change the findRelationsForUser function in ext/community/Classes/Domain/Repository/RelationRepository.php
As i set default limit to 0 and just add setLimit() to query if > than 0 , this should work also with existing installations.
(because actually the configuration for Limit is not set in setup.txt)
/
public function findRelationsForUser(Tx_Community_Domain_Model_User $user , $limit=0*) {
$query = $this->createQuery();
- $limit = intval($limit);
if ( $limit > 0) {
$query->setLimit($limit) ;
}*
return $query->matching(
$query->logicalAnd(
$query->logicalOr(
$query->equals('initiatingUser', $user),
$query->equals('requestedUser', $user)
),
$query->equals('status', Tx_Community_Domain_Model_Relation::RELATION_STATUS_CONFIRMED)
)
)->execute();
}