Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2024-01-10 21:44:43

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

Re: duplicate articles in admin page, not in mysql database. How to fix ?

etc wrote #336340:

Now txp tries to modify only concerned nodea

Ah yes. Forgot you’d changed that. In which case, it may be that if it was corrupt, JimJoe got lucky with choosing the correct nodes and it cascade rebuilt the affected tree.


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

#14 2024-01-10 21:46:48

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

Re: duplicate articles in admin page, not in mysql database. How to fix ?

etc wrote #336340:

One has to call rebuild_tree_full() php function to this end.

Speaking of which, is there any logical place in the Txp UI we can squeeze this functionality? A button/link and confirmation to rebuild the tree. Or should we leave it to a plugin like rss_sdmin_db_manager to expose?


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

#15 2024-01-10 21:49:23

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,551
Website

Re: duplicate articles in admin page, not in mysql database. How to fix ?

Bloke wrote #336342:

Speaking of which, is there any logical place in the Txp UI we can squeeze this functionality? A button/link and confirmation to rebuild the tree. Or should we leave it to a plugin like rss_sdmin_db_manager to expose?

If I’ve understood it correctly, it’s not really a DB operation. Perhaps under “Advanced options” in the settings?

Or as it seems to be very rare, as a troubleshooting note in the docs? I’m guessing it can be run by creating a page with a txp:php snippet and running that?


TXP Builders – finely-crafted code, design and txp

Offline

#16 2024-01-10 21:53:53

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

Re: duplicate articles in admin page, not in mysql database. How to fix ?

jakob wrote #336343:

If I’ve understood it correctly, it’s not really a DB operation.

It is. It completely rebuilds all the left/right pointer links in the txp_category table.

Or as it seems to be very rare, as a troubleshooting note in the docs?

That would work. In theory, it shouldn’t be necessary but, y’know, code.

I’m guessing it can be run by creating a page with a txp:php snippet and running that?

Yes, absolutely, assuming the appropriate allow PHP setting(s) are on (which are off by default from 4.9.0+).

Last edited by Bloke (2024-01-10 21:55:59)


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

#17 2024-01-10 21:58:42

JimJoe
Member
From: United States
Registered: 2010-01-30
Posts: 572
Website

Re: duplicate articles in admin page, not in mysql database. How to fix ?

Less than 600 entries on that site.

Offline

#18 2024-01-10 22:13:27

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

Re: duplicate articles in admin page, not in mysql database. How to fix ?

We could add rebuild links to categories tab, especially if there is an easy way to detect a corrupt tree. But I still can’t see how category tree corruption can duplicate articles list.

Offline

#19 2024-01-10 22:33:18

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

Re: duplicate articles in admin page, not in mysql database. How to fix ?

Me neither. Unless the tree somehow violated the index, the category name that is naughtily used as the foreign key in the textpattern table should be unique.

If there were, somehow, two entries with identical names, surely any article assigned to it would still pick the first one it found when it did the join? And that should be consistent each time it’s called.

Baffling.


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

#20 2024-01-16 04:44:59

JimJoe
Member
From: United States
Registered: 2010-01-30
Posts: 572
Website

Re: duplicate articles in admin page, not in mysql database. How to fix ?

I’ve added more articles, no duplicates.

When I inserted the articles via cpanel mysql, I made sure there were no duplicates. The import stops anyway, if an article number is already there.

Offline

#21 2024-02-23 16:01:47

JimJoe
Member
From: United States
Registered: 2010-01-30
Posts: 572
Website

Re: duplicate articles in admin page, not in mysql database. How to fix ?

etc wrote #336340:

That was true in 4.8.7, but took too much time (~1s per 1000 categories) on category-rich sites (some have >6000 categories). Now txp tries to modify only concerned nodes, which is much faster, but does not repair broken trees. One has to call rebuild_tree_full() php function to this end.

Absolutely.

How would I call that php function ? I have access to the cpanel for my sites.

Offline

Board footer

Powered by FluxBB