#61 ✓resolved
Gaspard Bucher

query finds multiple instances of the same node

Reported by Gaspard Bucher | September 3rd, 2008 @ 03:02 PM | in public beta

Originally posted on Trac by gaspard Original Trac Ticket

 Description (Last modified by gaspard)

Even though we use 'DISTINCT'. We should add a 'group by nodes.id' clause.

... except Pagination does not accept 'group'. We could just patch rails for now with this.

Trac Attachments

Trac Comments

2007-08-22 17:31:54 changed by gaspard

This seems to be worse then I thought. Pagination is being removed from rails (when should use some fancy plugin instead). There are so many super paginators out there http://errtheblog.com/post/4791 that it's time to use our own.

Why ? Because if there are many, this means there are many ways to use pagination. We need a very simple paginator that will work fine with zafu. I think adding a simple offset is enough for now, showing a forward arrow when there are no more pages to show is not such an issue.

description changed.

This seems to be worse then I thought. Pagination is being removed from rails (when should use some fancy plugin instead). There are so many super paginators out there http://errtheblog.com/post/4791 that it's time to use our own.

Why ? Because if there are many, this means there are many ways to use pagination. We need a very simple paginator that will work fine with zafu. I think adding a simple offset is enough for now, showing a forward arrow when there are no more pages to show is not such an issue.

description changed.

2007-08-22 17:46:27 changed by gaspard

(In [722]) Fixed bug where match query finds the same node more then once. Closes #61. These corrections will not work with search queries as these use the pagination and 'group' is not supported. Refs #61.

status changed from new to closed.

resolution set to fixed.

(In [722]) Fixed bug where match query finds the same node more then once. Closes #61. These corrections will not work with search queries as these use the pagination and 'group' is not supported. Refs #61.

status changed from new to closed.

resolution set to fixed.

2007-08-22 17:49:49 changed by gaspard

Not closed. Search query still needs a fix by rewriting a pagination service.

status changed from closed to reopened.

resolution deleted.

Not closed. Search query still needs a fix by rewriting a pagination service.

status changed from closed to reopened.

resolution deleted.

2007-08-22 18:19:26 changed by gaspard

We could do something like :

previous_page, collection, next_page = Node.find_with_pagination(opts.merge(:offset => (per_page * (current_page-1)), :limit => per_page)) or previous_page, collection, next_page = Node.find_with_pagination(page, per_page, opts)

==> previous_page = nil or number ==> collection = nil or [node, node, ...] ==> next_page = nil or number

That's all we need.

priority changed from minor to major.

We could do something like :

previous_page, collection, next_page = Node.find_with_pagination(opts.merge(:offset => (per_page * (current_page-1)), :limit => per_page)) or previous_page, collection, next_page = Node.find_with_pagination(page, per_page, opts)

==> previous_page = nil or number ==> collection = nil or [node, node, ...] ==> next_page = nil or number

That's all we need.

priority changed from minor to major.

2007-08-23 12:46:21 changed by gaspard

(In [723]) Fixes #61 (custom pagination)

status changed from reopened to closed.

resolution set to fixed.

(In [723]) Fixes #61 (custom pagination)

status changed from reopened to closed.

resolution set to fixed.

No comments found

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Anyone knows how to use formatting here ?

Git repository: http://github.com/zena

Official website: http://zenadmin.org

Shared Ticket Bins

People watching this ticket

Tags

Referenced by

Pages