I have the following:
A bug has a state and hasandbelongs to many usergroups among other
things.
Now, when listing the bugs I used the pagination helper and also give
the user the ability to filter it by various setting. Works great so
far. You can filter it by project, you can filter it by state (via the
state_id property of the bug) and by several other items. Now they
want it to be filtered by the groups that are responsible for the bug.
Since this is a HABTM connection I used "joins" to connect up the
tables.
This is what my $this->paginate looks like:
[limit] => 10
[contain] => Array
(
[0] => Project
[1] => User
[2] => Priority
[3] => State
[Comment] => Array
(
[0] => User
)
[4] => Screenshot
[5] => Group
)
[conditions] => Array
(
[Bug.project_id] => 26
[Bug.state_id] => 1
)
[Bug] => Array
(
[joins] => Array
(
[0] => Array
(
[table] => bugs_groups
[alias] => BugsGroups
[type] => inner
[conditions] => Array
(
[0] => BugsGroups.bug_id = Bug.id
)
)
[1] => Array
(
[table] => groups
[alias] => Group
[type] => inner
[conditions] => Array
(
[0] => Group.id =
BugsGroups.group_id
[Group.id] => 9
)
)
)
)
The strange thing is - as soon as I look for a Group by using the
"join" it's as if part (but strangely enough not all) of the basic
conditions are ignored. In fact, the condition for the project_id is
still honored, but the condition for the state_id is ignored. And I
can't seem to wrap my head around where the problem lies...
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en