Page MenuHomePhabricator

SMWRSSResultPrinter ignores query order when date is used
Closed, ResolvedPublic

Description

Author: sergey.chernyshev

Description:
SMWRSSResultPrinter ignores query order when one of selected fields is date (renamed to "date") to be used as feed date.

It forces the order to be descending while some queries might rely on order to be ascending.

For example, I want to order my query to return 30 next conferences starting today and I limit the query to return 30 results and use "Start date" as a date like this:

{{#ask:[[Category:Conference]] [[Start date::+]] [[End date::>now]]

?Start date=date
sort=date
order=asc
format=rss
searchlabel=RSS
rsstitle=TechPresentations.org: Current and Upcoming Conferences
rssdescription=Current and Upcoming conferences
limit=30

}}

If I'll use "desc" order then it'll return 30 conferences starting with the last one as far in the future as system holds while I just need next 30 conferences starting today.

Since the order of items within RSS feed doesn't make any difference, I propose to keep query order.

Patch is attached.


Version: unspecified
Severity: minor

Details

Reference
bz14097

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:08 PM
bzimport set Reference to bz14097.

sergey.chernyshev wrote:

Patch to keep query sort order

Attached:

Re-assign to extension developer for triage/comments.

Applied patch, and inserted special case into SMWQueryProcessor to make DESC the default order for RSS (you usually want most recent items first there).