Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
We should add pagination to the pending relationships page to prevent it from getting super long and to keep it consistent with the relationships pages. A configurable number of results per page would be desirable to make the page more flexible.
Comment | File | Size | Author |
---|---|---|---|
#2 | urpagepending_0.patch | 5.45 KB | prfctns6@gmail.com |
#1 | urpagepending.patch | 5.54 KB | prfctns6@gmail.com |
Comments
Comment #1
prfctns6@gmail.com CreditAttribution: prfctns6@gmail.com commentedAttached is a patch that adds pagination to the pending relationships page. Two queries are performed, one for pending sent requests and one for pending received requests, and each are paged independently. The code uses the same user_relationships_relationships_per_page variable that controls the number of relationships to be shown on the relationships page(s).
Comment #2
prfctns6@gmail.com CreditAttribution: prfctns6@gmail.com commentedPrevious patch had a stupid mistake in setting the page title. D'oh!
Comment #3
sprsquish CreditAttribution: sprsquish commentedThe diff was based on version 1.6 of the _theme file. Most recent version is 1.8 and all changes were rejected by CVS. Please resubmit diffed to the most recent version.
Comment #4
sprsquish CreditAttribution: sprsquish commentedack.. scratch that. I was looking at the wrong file
Comment #5
sprsquish CreditAttribution: sprsquish commentedPatched.
I changed the code a lot; cleaned it up to make it easier to read, removed user_load.
The location and user of user_load would have created a potentially huge performance hit. It would have sent a DB request for every relationship request, loaded the user, then called the user hook for all modules probably creating another large set of DB requests. Since we really only need the data from the user table I joined that table to the query and faked the functionality of the user object within the relationship object. This means cutting the number of DB hits down to exactly two.
Comment #6
prfctns6@gmail.com CreditAttribution: prfctns6@gmail.com commentedSweet - didn't know you could pass to theme_user an object was returned by user_load. Thanks for fixing that!