Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2009-02-02 15:56:29
- saccade
- Plugin Author
- From: Neubeuern, Germany
- Registered: 2004-11-05
- Posts: 521
Sorting issue with time="any"
I just tracked a problem with sorting behaviour.
I’ve created a form, which outputs an article list (just linked titles) containing events and related articles. Some of the events have a future timestamp, due to site structure. So I used time="any"
Here the code:
<txp:article_custom status="live" time="any" category="musik-aktuell" limit="12" form="rechtespalte" /></div>
The sort order wasn’t specified, so the default “Posted desc” was active.
This has been working for more than a year now without problems.
But now I tried to change the sort order to “asc”.
And this caused the problem:
<txp:article_custom status="live" time="any" category="musik-aktuell" limit="12" form="rechtespalte" sort="Posted asc" /></div>
doesn’t show future articles. Obviously time=“any” doesn’t work (or isn’t taken into account).
Trying to locate the error, I also tried the sort-attribute, but
<txp:article_custom status="live" time="any" category="musik-aktuell" limit="12" form="rechtespalte" sort="Posted desc" /></div>
works correctly as the code without the sort-attribute.
Then I tried time=“future” and this is working correctly with both directions, asc and desc.
So my current troubling scenario:
time=“any” sort=“Posted desc” is working
time=“any” is working
time=“any” sort=“Posted asc” is not working
The problem doesn’t seem to be new, I first noticed it in 4.0.6 (today) but it remained after the upgrade to txp 4.0.8.
Last edited by saccade (2009-02-02 16:22:18)
Offline
#2 2009-02-05 08:02:58
- saccade
- Plugin Author
- From: Neubeuern, Germany
- Registered: 2004-11-05
- Posts: 521
Re: Sorting issue with time="any"
Update: Tried the same on a complete fresh install, it worked correctly.
But in my working installation it doesn’t.
Weird problem.
Offline
Re: Sorting issue with time="any"
Try switching to debug mode and compare the SQL queries you see in the HTML source on both testing and live/working installation. If there is no difference, then try executing those queries using PHPmyAdmin to see if it’s a database issue or a TXP issue.
Offline
#4 2009-02-06 23:17:59
- saccade
- Plugin Author
- From: Neubeuern, Germany
- Registered: 2004-11-05
- Posts: 521
Re: Sorting issue with time="any"
Thank you very much for the tipp. It solved the problem (in fact there was no malfunction, it works quite properly) and revealed a poorly thought presentation concept, for which I’m responsible (I’m embarrassed, how could I miss this?):
In the list of article titles I present articles of a category. The list is limited to 12. In a form I sort out expired articles. So a list of 12 articles was correctly generated. 9 of them were expired, thus filtered out – and only the last three were visible. Just by accident or coincidence these were exactly “past” articles, whereas the “future” articles were missing (they simply weren’t part of the list of 12).
So no problem. Thanks for helping me to figure it out.
I’ll have to think about another way to get a correct list, without “expired” articles counting.
Offline
Pages: 1