Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-07-20 13:17:41

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

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

#2 2008-07-20 13:59:03

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

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

#3 2008-07-20 14:04:25

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

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

#4 2008-07-20 14:09:58

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

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

#5 2008-07-20 14:19:54

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

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

#6 2008-07-20 14:33:26

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

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

#7 2008-07-20 14:42:39

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

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

#8 2008-07-20 14:57:34

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

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

#9 2008-07-20 15:06:02

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

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

#10 2008-07-20 15:20:19

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: We need some testers please - Deleting Categories Problem

Correct.

Offline

#11 2008-07-20 15:22:48

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

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

#12 2008-07-20 15:33:40

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

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

#13 2008-07-20 15:50:25

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: We need some testers please - Deleting Categories Problem

According to the page’s souce code, value=“35” so I assume that is the ID. No, the category I tried to delete has no images in it and does not appear in that list. It is newly created though I created one that I will need so the fact that I can’t delete it at the moment is not a big hassle.

Something has occurred to me whilst doing this. This site is hosted by Media Temple. When I was getting the passwords and login information from Matthew I noticed that there were 2 paths to the database, one “internal” and one “external”. I’m using the one I was told to but I’m wondering if there may be certain “permission” restrictions on the path I’m using? Maybe I can create and modify but not destroy? I haven’t tried to delete any actual articles, images or files though I have overwritten. Shall I modify the config and try the other path? See if it has any effect?


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#14 2008-07-20 15:56:51

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: We need some testers please - Deleting Categories Problem

If Textpattern doesn’t attempt delete (there’s no DELETE query showing in your post), this can have two reasons only:
  • the category is still in use… but it’s not, you say, so we can ignore this one
  • the category is a parent to other categories. A newly created category is not a parent. You can check this by viewing the contents of the txp_category table (perhaps using Rob Sable’s database manager plugin) and checking if the values for rgt and lft are just 1 apart (rgt minus lft should be equal to 1). If that’s not true for a new category, I think your category table is corrupt.

I’m not quite sure what you mean by database paths, although I doubt it would cause this. It won’t hurt trying though…

Last edited by ruud (2008-07-20 15:59:58)

Offline

#15 2008-07-20 16:04:13

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: We need some testers please - Deleting Categories Problem

Mmm. Well I’ve checked all the categories via the tab and there are no parents showing. It’s not something I use.

Let me install the plug-in and get back.


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

Board footer

Powered by FluxBB