Re: Paginate not returning correct hasNext
Ignore me. My afterFind callback was changing the value! Only took
me 2 hrs to track that one down! Doh!
On Dec 3, 2:22 pm, TobyG <Goo...@Toby-G.net> wrote:
> I've implemented pagination on my bookings system, & the paginator
> helper is not enabling the next button, despite there being further
> records on the following page. I have tracked the problem down to the
> following line in the controller.php core file, where it seems that it
> is returning the wrong value for $count...
>
> @ approx line 1070 controller.php
> $count = $object->find('count', array_merge($parameters, $extra));
>
> For some reason it is returning 1, even though there are 3 records
> that match this search criteria.
>
> Here is the merged array <array_merge($parameters, $extra)> for
> reference...
>
> Array
> (
> [conditions] => Array
> (
> [Dj.user_id] => 1
> )
> [contain] => Array
> (
> [0] => Dj
> [Event] => Array
> (
> [0] => Night
> )
> [Promoter] => Array
> (
> [0] => User
> )
> )
> )
>
> I even ran the SQL statement that this generates (copied from the
> debugging info at the bottom of the page)...
>
> SELECT COUNT(*) AS `count` FROM `bookings` AS `Booking` LEFT JOIN
> `djs` AS `Dj` ON (`Booking`.`dj_id` = `Dj`.`id`) WHERE `Dj`.`user_id`
> = 1
>
> ... and it gave me the correct answer of 3, so why is cake returning
> 1?
>
> Please help!
>
> Toby
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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home