Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#25 2021-05-24 06:35:05
- gomedia
- Plugin Author
- Registered: 2008-06-01
- Posts: 1,373
Re: adi_detritus - Sweep up the rubbish
Version 0.6 now available:
- fix: removed objection to INSTALL.txt & UPGRADE.txt (for TXP 4.8.5)
- fix: “Missing” language string name change (for TXP 4.8)
- fix: improved event discovery
- new: warnings for uninstalled plugins that have files in textpattern/plugins dir
Offline
#26 2021-07-01 04:33:43
- gomedia
- Plugin Author
- Registered: 2008-06-01
- Posts: 1,373
Re: adi_detritus - Sweep up the rubbish
Updated to 0.7 – now with added plugin perusal:
- new: removed objections to all .webmanifest files
- new objections your honour: textpattern/jquery.js, textpattern/txp_img (4.6+)
- new: check writability of image thumbnails
- new: TXP 4.8+ plugin file & manifest checks – type/order/code mismatches
- improved: slightly less whingey about images
Offline
Re: adi_detritus - Sweep up the rubbish
Hi Adi,
given the upcoming changes in the categories management (notably that their tree is not rebuilt on each operation any more), would it be possible to add a tree integrity check/repair to adi_detritus
? Just in case :-) Thanks.
Offline
#28 2021-11-12 10:47:27
- gomedia
- Plugin Author
- Registered: 2008-06-01
- Posts: 1,373
Re: adi_detritus - Sweep up the rubbish
etc wrote #331932:
given the upcoming changes in the categories management (notably that their tree is not rebuilt on each operation any more), would it be possible to add a tree integrity check/repair to
adi_detritus
? Just in case :-) Thanks.
Sure thing, but could you point me in the direction of categories management changes?
Offline
Re: adi_detritus - Sweep up the rubbish
gomedia wrote #331933:
Sure thing, but could you point me in the direction of categories management changes?
Thanks. The db/tree structure remains unchanged. Currently (4.8.7) the whole tree is rebuilt when some category is altered (inserted/moved/deleted). This keeps the tree sane but yields two db queries per category, which can become rather long for heavily categorized sites (1000 cats or more).
In 4.8.8 these operations are optimized and everything should work fine. But, if someone manipulates categories outside of txp, things can go west. Since the cat tree is not fully rebuilt by core any more, users would be lost in this case. I thought adi_detritus
might add a ‘repair’ possibility, just in case. Of course, we could do it in core, but the feature would be of no use for most users.
Few things that adi_detritus
might check and rebuild the tree if needed:
- orphan children (parent do not exist)
- wrong nesting (category not within the branch of its parent)
- orphan parents (missing children)
The first point is easy. For the second one, you might test
SELECT child.id FROM txp_category child, txp_category parent
WHERE child.parent=parent.name
AND child.type=parent.type
AND (child.lft<=parent.lft OR child.rgt>=parent.rgt)
The third one looks more tricky, I leave it with you ;-)
Edit: also, starting from some version, category name must be lowercase. Older sites could thus contain invalid category names.
Offline