Opened 6 years ago

Last modified 2 years ago

#728 in_progress defect

Collection page shows thumbnails in reverse order

Reported by: Kushal Kumaran Owned by: Boris Bobrov
Priority: major Milestone:
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.

Subtickets

Attachments (1)

show-collection-in-reverse-created-order.patch (1.5 KB) - added by Kushal Kumaran 6 years ago.
patch that fixes the order

Download all attachments as: .zip

Change History (16)

Changed 6 years ago by Kushal Kumaran

patch that fixes the order

comment:1 Changed 6 years ago by Kushal Kumaran

Status: newreview

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 Changed 6 years ago by rodney757

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 Changed 6 years ago by rodney757

Status: reviewaccepted

comment:4 Changed 5 years ago by Boris Bobrov

Status: acceptedreview

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 Changed 4 years ago by berkerpeksag

Status: reviewaccepted

Sorry, I couldn't find the patch in both devel and develop branches. Could you point it out again?

comment:7 Changed 3 years ago by Loic Dachary

Status: acceptedreview

comment:8 Changed 2 years ago by Boris Bobrov

Wow, cool. Merging this since i have commit rights now!

comment:9 Changed 2 years ago by Boris Bobrov

fixed in dbb86ff

comment:10 Changed 2 years ago by Boris Bobrov

Resolution: fixed
Status: reviewclosed

comment:11 Changed 2 years ago by Boris Bobrov

Reopening because of 9d935dd

comment:12 Changed 2 years ago by Boris Bobrov

Resolution: fixed
Status: closedaccepted

comment:13 Changed 2 years ago by Boris Bobrov

Owner: set to Boris Bobrov
Priority: minormajor
Status: acceptedin_progress

comment:14 Changed 2 years ago by Ben Sturmfels

Cc: R13ose 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 Changed 2 years ago by Ben Sturmfels

Cc: ShawnRisk added; R13ose removed
Note: See TracTickets for help on using tickets.