Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#25 2021-09-01 21:31:26

etc
Developer
Registered: 2010-11-11
Posts: 5,149
Website GitHub

Re: Slow adding New Categories

Altering categories should be much faster in 4.8.8 now, especially when you have thousands of them. This has required much code rewriting, so please test if everything works as expected. We are waiting for Phil’s opinion to eventually change the HTML markup on the admin side.

As a by-product, <txp:category_list /> has got some enhancements to easily output category trees/branches:

<!-- output a nested tree of 'somecat' children -->
<txp:category_list parent="somecat" children wraptag="ul" break>
    <txp:category />
</txp:category_list>

<!-- output the path from parent to child category -->
<txp:category_list parent="somecat" categories="childcat" wraptag="ul" break  />

Offline

#26 2021-09-01 21:35:48

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,536
Website GitHub Twitter

Re: Slow adding New Categories

Thanks Oleg,

I will make some testings next week.

Offline

#27 2021-09-02 05:39:56

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,152
Website

Re: Slow adding New Categories

etc wrote #331499:

Altering categories should be much faster in 4.8.8 now, especially when you have thousands of them.

a first quick test, with about 50 categories: category lists and category based pages feel faster. And all still display as expected so far :-) Will see if/how I can test with more categories (thousands probably not, though, wouldn’t know how to handle those…)

BTW, I had a play at building the category panel as a list (mockup, articles only) – here.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#28 2021-09-02 07:57:49

etc
Developer
Registered: 2010-11-11
Posts: 5,149
Website GitHub

Re: Slow adding New Categories

phiw13 wrote #331502:

a first quick test, with about 50 categories: category lists and category based pages feel faster. And all still display as expected so far :-) Will see if/how I can test with more categories (thousands probably not, though, wouldn’t know how to handle those…)

I have tested with ~1000 categories, and, say, deleting few categories switches from ~1000 queries and 1.7s to almost immediately. You can call

<txp:php>rebuild_tree_full('article');</txp:php>

to emulate the previous behaviour (and also restore the tree if anything goes west).

BTW, I had a play at building the category panel as a list (mockup, articles only) – here.

Looks fine, thank you. I leave the decision with you UX gurus.

Offline

#29 2021-09-11 10:16:01

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,536
Website GitHub Twitter

Re: Slow adding New Categories

Hi

I downloaded today the 4.8.8 branch to test the category change but got an error message when going to admin :

( ! ) Fatal error: Uncaught TypeError: Return value of Textpattern\Textfilter\Registry::offsetSet() must be an instance of Textpattern\Textfilter\void, none returned in C:\wamp64\www\textpattern-4.8.7\textpattern\vendors\Textpattern\Textfilter\Registry.php on line 160
( ! ) TypeError: Return value of Textpattern\Textfilter\Registry::offsetSet() must be an instance of Textpattern\Textfilter\void, none returned in C:\wamp64\www\textpattern-4.8.7\textpattern\vendors\Textpattern\Textfilter\Registry.php on line 160

It s a dev branch after all.

Cheers.

Offline

#30 2021-09-11 10:19:25

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,536
Website GitHub Twitter

Re: Slow adding New Categories

phiw13 wrote #331502:

BTW, I had a play at building the category panel as a list (mockup, articles only) – here.

I Phil, it s really nice, it s good to see the ul/li construction after all, i can then publish some little plugins to add some functions like: Show/Hide children / Slide to a desired category / View name category or title category, …

Cheers.

Offline

#31 2021-09-11 10:30:19

etc
Developer
Registered: 2010-11-11
Posts: 5,149
Website GitHub

Re: Slow adding New Categories

Dragondz wrote #331557:

I downloaded today the 4.8.8 branch to test the category change but got an error message when going to admin :

Hi,

misery, void return type was added in php 7.1. Try removing these declarations in textpattern\vendors\Textpattern\Textfilter\Registry.php (then php 8.1 will complain).

Offline

#32 2021-09-11 11:01:28

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,433
Website GitHub

Re: Slow adding New Categories

Uhhh rock and a hard place. That’s annoying. Almost forces us to adopt 7.1 minimum. Drat.


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

#33 2021-09-11 12:23:43

etc
Developer
Registered: 2010-11-11
Posts: 5,149
Website GitHub

Re: Slow adding New Categories

Bloke wrote #331560:

Uhhh rock and a hard place. That’s annoying. Almost forces us to adopt 7.1 minimum. Drat.

Yep. Or release two versions, but seemingly webhosts sometimes upgrade php without warning the users.

Actually, we don’t seem to use the conflicting code anywhere in core. I also doubt any plugin needs it. So we could probably just comment it out?

Offline

#34 2021-09-11 13:14:40

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,433
Website GitHub

Re: Slow adding New Categories

etc wrote #331563:

we don’t seem to use the conflicting code anywhere… So we could probably just comment it out?

Worth a try.


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

#35 2021-09-13 07:09:51

etc
Developer
Registered: 2010-11-11
Posts: 5,149
Website GitHub

Re: Slow adding New Categories

This seems finally work. Tested on php 8.1, 8.0.10 and 5.4.8, more version tests are welcome.

Offline

#36 2021-09-13 08:54:53

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,536
Website GitHub Twitter

Re: Slow adding New Categories

Hi

Yes error gone (php 7.0.32).

I tested the category tab (Adding categories, modifying, change parent, deleteing) have got no problem. (I have 2000 cat in the tab).

Cheers.

Offline

Board footer

Powered by FluxBB