Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2019-08-14 12:52:58

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,454
Website

Re: Order of txp:category_list not as expected…

You might want to try if the most recent version behaves like it should. If you don’t want to update the entire site to the dev version, find the file /textpattern/publish/taghandlers.php (make a backup to return to if it doesn’t work) and replace the function category_list with the current version from the dev branch here.

I’m not entirely sure whether those changes depend on other aspects. These issues and these two commits seem to be the most recent ones affecting the categories_list tag.


TXP Builders – finely-crafted code, design and txp

Online

#12 2019-08-14 13:03:10

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,665
Website

Re: Order of txp:category_list not as expected…

I’m really interested in figuring out why this doesn’t work for you. Have sent you an email.

As far as I can make out reading the code, in 4.7.3 (maybe even 4.7.2, actually) there is a bug that if you specify a list of categories you must override the sort attribute with sort="", otherwise it will default to name asc. That’s been fixed in current dev by detecting if you’re using the categories attribute and only setting the sort defaults if not.

So I’m intrigued why it didn’t work with Michael’s suggestion at the top of this thread.

Last edited by Bloke (2019-08-14 13:17:03)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#13 2019-08-14 13:07:45

Kjeld
Member
From: Tokyo, Japan
Registered: 2005-02-05
Posts: 239
Website

Re: Order of txp:category_list not as expected…

Bloke wrote #319050:

I’m really interested in figuring out why this doesn’t work for you. Have sent you an email.

As far as I can make out reading the code, in 4.7.3 there is a bug that if you specify a list of categories you must override the sort attribute with sort="", otherwise it will default to name asc. That’s been fixed in current dev by detecting if you’re using the categories attribute and only setting the sort defaults if not.

So I’m intrigued why it didn’t work with Michael’s suggestion at the top of this thread.

Oh, I misunderstood Michael’s suggestion and didn’t try sort="". I thought he was suggesting to close the tag…


JapaneseStreets.com – Japanese street fashion (mostly txp)
Old Photos of Japan – Japan between 1860 and 1940 (100% txp)
MeijiShowa – Stock photos of Japan between 1860 and 1940 (100% txp)

Offline

#14 2019-08-14 14:11:59

etc
Developer
Registered: 2010-11-11
Posts: 3,170
Website

Re: Order of txp:category_list not as expected…

That’s intriguing me:

After I upgraded to txp 4.7.3, the order of the categories of txp:category_list is no longer as expected…

I don’t think we have changed sort attribute behaviour in 4.7, it was always defaulting to name ASC if not set explicitly.


etc_[ query | search | pagination | date | tree | cache ]

Offline

#15 2019-08-14 14:36:55

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,665
Website

Re: Order of txp:category_list not as expected…

etc wrote #319053:

I don’t think we have changed sort attribute behaviour in 4.7, it was always defaulting to name ASC if not set explicitly.

Hmmmm…. That was just prior to 4.7.2 being released I think. But maybe I’m missing something.

Note to self/devs/community: Let’s compile a tag Unit Test library as a matter of urgency so we can help catch tag regressions.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#16 2019-08-14 14:49:04

etc
Developer
Registered: 2010-11-11
Posts: 3,170
Website

Re: Order of txp:category_list not as expected…

Oops, right, one bug’s fix is another bug’s birth. Hopefully in dev everything is fine.


etc_[ query | search | pagination | date | tree | cache ]

Offline

#17 2019-08-14 14:55:28

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,665
Website

Re: Order of txp:category_list not as expected…

etc wrote #319055:

Oops, right, one bug’s fix is another bug’s birth. Hopefully in dev everything is fine.

Yeah, no worries. Seems to be working fine in my tests.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB