When I sort feed items by the Day of their creation, the view doesn't order the nodes properly. However, when the granularity option is left on normal, it does.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

taqwa’s picture

Just to clarify the problem a little further. When I select Granularity:Day, I understand that the sort order will ignore all other times and just sort by the day of the post. However, it's not doing this. Instead the order seems to be quite random. I also tried making a rule that sorts by Granularity: Year or Granularity: Month, but this causes the view to crash. I just get an empty page with the pager at the bottom.

merlinofchaos’s picture

Status: Active » Fixed
FileSize
1.73 KB

Ok, I found two problems. Minute granularity was broken due to the confusion between %m -- it's month, not minute. Day granularity was slightly off because it was failing to correct for timezone. Both problems are fixed and checked in; and because I'm feeling generous, here's the patch

meatbites’s picture

Brilliant! Thanks for providing this, Earl.

I just noticed something, though -- the last argument for DATE_FORMAT under month is '%Y%m% -- should that have a closing apostrophe?

merlinofchaos’s picture

FileSize
1.72 KB

Ack. You're right -- also, there are extraneous % on both 'month' and 'year'. I don't THINK those extra % should cause issues, but it's hard to say.

Updated patch attached. (also committed to -dev).

meatbites’s picture

This seems to work well.

The sorts also work when all the percent signs are removed. They're there for a reason, though, I guess...

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

asund’s picture

I couldn't get this to work so i did a bit of testing.
It's strange, but when i changed %Y%m%%d to %Y%m%j it worked fine!
It doesn't really make sense to me, but as long as it works, I'm happy! ;)

EDIT: Rushed to a conclusion there.. still some problems!