Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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
Online
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
Online
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
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
Online
Re: duplicate articles in admin page, not in mysql database. How to fix ?
Less than 600 entries on that site.
Offline
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
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
Online
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
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