Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
We need some testers please - Deleting Categories Problem
Currently doing a new site. I’m on r2937. I noticed when I first installed that I couldn’t delete the existing 3 categories so I simply renamed them and have created another 3 since then. A complete change of method now means that I don’t require them at all. I have taken the articles that were in them out via the “Articles” tab “mass edit” facility so there are no longer any articles in any of the categories however on the “Categories” tab TXP will not let me delete them via the “mass edit” facility. The categories are displaying as empty. I have tried deleting “en masse” and individually without success. Any ideas?
EDIT: The above related to article categories however I have just tried to delete an empty image and file category without success as well.
Last edited by thebombsite (2008-07-20 20:11:58)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: We need some testers please - Deleting Categories Problem
If you create a new category and then immediately try deleting that… does that work?
Offline
Re: We need some testers please - Deleting Categories Problem
Just tried that and no it won’t.
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: We need some testers please - Deleting Categories Problem
Please disable all plugins and post your diagnostics, because I can’t reproduce that problem.
Offline
Re: We need some testers please - Deleting Categories Problem
I tried deleting after disabling all plug-ins but still no joy. Here are the full diagnostics:-
Edit: Diagnostics removed.
Last edited by thebombsite (2008-07-20 16:33:14)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: We need some testers please - Deleting Categories Problem
What did you change in constants.php?
Can you set DEBUG to 1 in constants.php and post the generated SQL queries after a delete attempts?
Offline
Re: We need some testers please - Deleting Categories Problem
I haven’t changed anything in those 2 files. They always show up as “modified” even in a brand new install. I’ve mentioned this before. I should specify that is an SVN install. I don’t think they appear using the official download but it’s that long since I used anything remotely official… ;)
I can set debug but I have no idea about the other part. How’s that done then? I should mention this is not my own site and I don’t currently have access to cPanel or whatever is used.
Last edited by thebombsite (2008-07-20 14:45:13)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: We need some testers please - Deleting Categories Problem
Setting DEBUG to 1 causes the SQL queries to be displayed whenever they are used (public side as well). So when you’ve tried deleting a category, you should see the queries involved displayed at the top of the screen. You don’t need any kind of special access to CPANEL or anything. Just setting DEBUG to 1 will do the trick, although you may not want to do this on a live site.
Offline
Re: We need some testers please - Deleting Categories Problem
Well it’s not totally “live” in the sense that it’s using your maintenance plug-in and I’m the only one who is really accessing the admin side at the moment. I presume this doesn’t potentially cause any problems? Just extra info on-screen?
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: We need some testers please - Deleting Categories Problem
Correct.
Offline
Re: We need some testers please - Deleting Categories Problem
OK. This appears at the top of the page above the navigation:-
describe `textpattern`
select val from txp_prefs where name = 'version'
select name, val from txp_prefs where prefs_id=1
select name, data from txp_lang where lang='en-us'
select nonce from txp_users where name='spinnaker' AND last_access > DATE_SUB(NOW(), INTERVAL 30 DAY)
select name, code, version from txp_plugin where status = 1 and type='1' order by load_order
select privs from txp_users where name='spinnaker'
select DISTINCT category from txp_image where 1=1
select id, name from txp_category where id IN (35) AND type='image' AND rgt - lft = 1 AND NOT name IN ('site-design','acoustics','audio','electrical','it-communication','lighting','video','article-images','cos','fbcb','gcfm','hcc','lumc','ssj','vcce')
select name, val from txp_prefs where prefs_id=1
select * from txp_users where name = 'spinnaker'
select privs from txp_users where name = 'spinnaker'
and this appears under the navigation:-
select lft as l, rgt as r from txp_category where name='root' and type = 'article'
select id, name, lft, rgt, parent, title from txp_category where lft between 1 and 14 and type = 'article' and name != 'root' and 1=1 order by lft asc
select Category1, count(*) as num from textpattern where 1 = 1 group by Category1
select Category2, count(*) as num from textpattern where 1 = 1 group by Category2
select lft as l, rgt as r from txp_category where name='root' and type = 'link'
select id, name, lft, rgt, parent, title from txp_category where lft between 1 and 4 and type = 'link' and name != 'root' and 1=1 order by lft asc
select category, count(*) as num from txp_link where 1 group by category
select lft as l, rgt as r from txp_category where name='root' and type = 'image'
select id, name, lft, rgt, parent, title from txp_category where lft between 1 and 34 and type = 'image' and name != 'root' and 1=1 order by lft asc
select category, count(*) as num from txp_image where 1 group by category
select lft as l, rgt as r from txp_category where name='root' and type = 'file'
select id, name, lft, rgt, parent, title from txp_category where lft between 1 and 10 and type = 'file' and name != 'root' and 1=1 order by lft asc
select category, count(*) as num from txp_file where 1 group by category
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: We need some testers please - Deleting Categories Problem
So, I’m guessing “35” is the ID of the category you’re trying to delete.
And these are the categories that are still in use: ‘site-design’,‘acoustics’,‘audio’,‘electrical’,‘it-communication’,‘lighting’,‘video’,‘article-images’,‘cos’,‘fbcb’,‘gcfm’,‘hcc’,‘lumc’,‘ssj’,‘vcce’
Is the name of category 35 one of those listed? If so, then there’s still an image linked to that category.
This is what I get when trying to delete two image categories: 9 is site-design (which is in use), 51 is a test category that isn’t in use so can be deleted:
select DISTINCT category from txp4_txp_image as txp_image where 1=1
select id, name from txp4_txp_category as txp_category where id IN (9,51) AND type='image' AND rgt - lft = 1 AND NOT name IN ('','site-design')
delete from txp4_txp_category where id IN (51) AND rgt - lft = 1
Note that you cannot delete a category that is that parent of other categories. First delete the children, then the parent.
Last edited by ruud (2008-07-20 15:40:05)
Offline