Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The aggregator module displays a page of 'sources' ( http://www.thomashousehold.net/aggregator/sources )but the sources are in the order they were entered into the system. Wouldn't it make sense to add an 'ORDER BY' clause and display in alphabetical order by feed title? I'd work on this myself but I'm still getting familiar with all the APIs and patching procedures, etc.
Thanks.
Comment | File | Size | Author |
---|---|---|---|
#6 | aggregator.module.patch39329b | 874 bytes | markus_petrux |
#2 | aggregator.module.patch39329a | 871 bytes | markus_petrux |
Comments
Comment #1
markus_petrux CreditAttribution: markus_petrux commentedIt still happens in 4.7 beta2, I was about to report this issue and found this.
This in fact looks like a bug to me. In the function aggregator_page_sources() a query (let's call it the outer query) is made to scan the {aggregator_feed} table and then an inner query scans the items in timestamp order. So there are two different queries here.
However, the first one (the outer query) does a JOIN with the items table to group the results by last item timestamp. This is how it looks:
Though 'last' is not used anywhere! ...I guess the intention was to order the sources page by last updated source first, so the query should probably look like this:
Note 5 refers to the 5th column specified in the query, which is "MAX(i.timestamp) AS last". I have also added the title, so feeds updated at the same time (more exactly not updated ;-) get ordered by title.
Comment #2
markus_petrux CreditAttribution: markus_petrux commentedI'm attaching the patch.
Comment #3
markus_petrux CreditAttribution: markus_petrux commentedJust a tiny patch, that changes the order in the sources pages to make a little more sense, IMO.
Comment #4
Cvbge CreditAttribution: Cvbge commentedAny reason you use ORDER BY 5 and not ORDER BY last? I'd prefer the later.
Comment #5
markus_petrux CreditAttribution: markus_petrux commentedOh, I guess this is no problem if it's supported by the underlying SQL engine, which I'm not sure.
I just get used to use numbers when referencing columns that use functions, because I had problems in the past (about 10y ago though, using DB2 under MVS).
Comment #6
markus_petrux CreditAttribution: markus_petrux commentedOk, here we go. I just checked with 'last' and worked on MySQL 4.1 so... please, see attached patch.
Cheers
Comment #7
markus_petrux CreditAttribution: markus_petrux commentedComment #8
Tobias Maier CreditAttribution: Tobias Maier commentedwas commited
http://drupal.org/cvs?commit=24021
Comment #9
(not verified) CreditAttribution: commented