Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Pagination returns wrong number of entries if duplicates exist #23
I am using the extension with Symphony 2.2.5, so I checked out the last compatible commit (8c64a08).
As far as I see, there has been no fix for my problem in the meantime.
I am using two datasources pulling from the same section. If entries occur in both datasources, the output XML will not contain duplicates (which is right, of course), but it will contain the wrong number of entries – the number is reduced by the number of duplicates.
So if I say "25 per page", it may as well be only 17. Funny: If the last entry on page 1 is a "duplicate" (i.e. will be output by both datasources), it will also occur as first entry on page 2.
I hope that this is something very simple to debug...
Here we go.
I found two problems, the first one being only a small one.
It simply doesn't work because there is whitespace before the
If I change:
the count works properly.
It seems to me that the "uniqueness" of entries has been handled by Symphony itself (or maybe by some other extension code). I don't see any side effects of forcing the uniqueness by using
So can you please check this suggestion and think about it?
Hey @michael-e! Thanks for debugging this.
added a commit
Aug 28, 2012
Good idea. If that doesn't work, we can still match the leading whitespace in the regex using
That was my use case, wasn't it? As I said,
Ah, I see. No, actually in these cases (using
Should I send a pull request for the
I was just about to log this one as well.
I logged an issue recently (last 6 months) on Symphony to ask for multiple sort by's in the datasource editor, and it was for this exact reason.
We have a project that sorts two datasources on different columns, and then Union's them to get one list of the two sorts, only problem is duplicates are removed. Setting either original datasource to not paginate (returning all entries) and then paginating in the Union DS still returns the incorrect count.