Opened 12 years ago
Last modified 3 years ago
#728 in_progress defect
Collection page shows thumbnails in reverse order
Reported by: | Kushal Kumaran | Owned by: | Boris Bobrov |
---|---|---|---|
Priority: | major | Milestone: | 0.13.0 |
Component: | programming | Keywords: | collections |
Cc: | ShawnRisk | Parent Tickets: |
Description
The collection page at /u/<username>/collection/<collection> shows thumbnails in order they were added. But the pagination link to go to the next page says "Older ->" implying that the thumbnails are being shown in reverse-created order.
Attachments (2)
Change History (19)
by , 12 years ago
Attachment: | show-collection-in-reverse-created-order.patch added |
---|
comment:1 by , 12 years ago
Status: | new → review |
---|
I have attached a patch that fixes the problem for me, following a suggestion on devel@. But my sqlalchemy-fu is pretty rudimentary, so someone more familiar will need to take a look.
comment:2 by , 11 years ago
Okay, so the reason it is backwards is because when you click on an item in a collection it actually takes you to the media page. When you click newer
or older
, it is just going through all the media that the user has uploaded, not just the media in that collection. I'm opening a ticket so that when you click on media from a collection, it only cycles through the collection instead of all the user's media.
That said I think you have the right idea for this for now. The whole order_col arg is unnecessary though, since the only other place that get_collection_items()
is called is when deleting the collection. All you need to do is change the query and order_col = MediaEntry.created
in get_collection_items()
.
Then I think this will be good to merge.
Thanks
comment:3 by , 11 years ago
Status: | review → accepted |
---|
comment:4 by , 11 years ago
Status: | accepted → review |
---|
I wonder why it was not applied.
I've fixed it in my https://gitorious.org/mediagoblin/bretons-mediagoblin/, branch develop, so code review is required.
comment:5 by , 10 years ago
Status: | review → accepted |
---|
Sorry, I couldn't find the patch in both devel and develop branches. Could you point it out again?
comment:6 by , 10 years ago
comment:7 by , 9 years ago
Status: | accepted → review |
---|
comment:10 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | review → closed |
comment:12 by , 8 years ago
Resolution: | fixed |
---|---|
Status: | closed → accepted |
comment:13 by , 8 years ago
Owner: | set to |
---|---|
Priority: | minor → major |
Status: | accepted → in_progress |
comment:14 by , 8 years ago
Cc: | added |
---|
Updating at Amelia Rose's request:
The reason for re-open was that the change introduced a bug as described in #5469:
"InvalidRequestError: Could not find a FROM clause to join from. Tried joining to <class 'mediagoblin.db.models.MediaEntry'>, but got: Can't find any foreign key relationships between 'core__collection_items' and 'core__media_entries'."
breton reverted this patch in 9d935dd, so it now needs a new patch that fixes the issue without introducing further issues.
comment:15 by , 8 years ago
Cc: | added; removed |
---|
by , 5 years ago
Attachment: | 0001-Sort-collections-by-date-added.patch added |
---|
comment:16 by , 5 years ago
I still have the problem to date, and I think I just found the root cause. See the comment in the attached patch. tl;dr: I think it's because the ordering is relying on a position
attribute that is never set. Using the date added
instead returns the items sorted as desired.
comment:17 by , 3 years ago
Milestone: | → 0.13.0 |
---|
patch that fixes the order