Phantom category?
-
Our nodebb has a phantom category that seems to appear at the bottom of all our categories. When inspecting, it has no CID but shows up in each theme. This is from our API view of categories for the category:
{"parentCid":0,"name":"","icon":"hidden","unread-class":"unread","children":[],"totalPostCount":0,"totalTopicCount":0,"posts":[]}],"title":"[[pages:categories]]","breadcrumbs":[{"text":"[[global:home]]","url":"/"},{"text":"[[pages:categories]]"}],"loggedIn":false,"relative_path":"","template":{"name":"categories","categories":true},"bodyClass":"page-categories"}
Any help will be much appreciated!
You can see it at the bottom here:
http://www.lntgamers.com/categories -
Hm, do you remember how you made this bug happen?
Please try the following:
- Re-order the category (move it to the parent level, or if already there, move it to be a sub-category under an existing category)
- Re-order it back out to the root level again.
-
I think things got really funky because I originally installed v0.8 but went to v0.7. We then upgraded to 0.8 and 0.9.
This is what it looks like when I disabled all my existing categories and added two test ones on v1.0. You can see I somehow have a negative post count on an empty category and the phantom one is there. It has no entry in the admin page and I've reordered these test categories up and down and inside/out. I cannot do the same for the phantom one.
Here is another screenshot in our dev environment.
The API json looks like the following:
{
"title": "[[pages:categories]]",
"categories": [
{
"cid": 79,
"name": "test2",
"description": "",
"icon": "fa-comments",
"bgColor": "#DC9656",
"color": "#fff",
"slug": "79/test2",
"parentCid": 0,
"topic_count": 0,
"post_count": 0,
"disabled": false,
"order": 10,
"link": "",
"numRecentReplies": 1,
"class": "col-md-3 col-xs-6",
"imageClass": "cover",
"undefined": "on",
"descriptionParsed": "",
"totalPostCount": 0,
"totalTopicCount": 0,
"unread-class": "",
"children": [],
"posts": []
},
{
"cid": 78,
"name": "test",
"description": "",
"icon": "fa-comments",
"bgColor": "#BA8BAF",
"color": "#fff",
"slug": "78/test",
"parentCid": 0,
"topic_count": -20,
"post_count": -126,
"disabled": false,
"order": 11,
"link": "",
"numRecentReplies": 1,
"class": "col-md-3 col-xs-6",
"imageClass": "cover",
"undefined": "on",
"descriptionParsed": "",
"totalPostCount": -126,
"totalTopicCount": -20,
"unread-class": "unread",
"children": [],
"posts": []
},
{
"parentCid": 0,
"name": "",
"icon": "hidden",
"unread-class": "unread",
"children": [],
"totalPostCount": 0,
"totalTopicCount": 0,
"posts": []
}
],
"breadcrumbs": [
{
"text": "[[global:home]]",
"url": "/"
},
{
"text": "[[pages:categories]]"
}
],
"loggedIn": false,
"relative_path": "",
"template": {
"name": "categories",
"categories": true
},
"bodyClass": "page-categories"
} -
@julian
Querying mongodb,I had a stray category 15 that looked like the following:
{
"_id" : ObjectId("56bd923fc113b09c466f9055"),
"_key" : "category:15",
"parentCid" : 0
}
I removed that entry from mongo and now the API returns a 'NULL' at the end of my categories API.Is there something else I should delete?