Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

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

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,499
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.

Hire 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: 573
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,689
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: 12,499
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.

Hire 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: 573
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: 573
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