You can try it, if you switch on the forum module, then automatically there is a ‘forum’ vocabulary created by drupal, if you go to: Administrator >> Categories.

I made the mistake of deleting this forum vocabulary, then I switched off the forum module, and didn’t think much of it.

Later on I switched on the forum module again and noticed the ‘forum’ vocabulary wasn’t created for me, consequently resulting in the forum not working.

My question is, how do I get this ‘automatic vocabulary’ creation back? As I believe I have permanently deleted that feature or broke it.

In hope of getting that feature back, I replaced the old forum module with a new one, but nothing has changed. I still can’t get the automatic form vocabulary creation back.

Please help me if you are able to.

Thanks.

Comments

vm’s picture

administer -> categories

add vocabulary
name Forum
type forum topic

jason342’s picture

Yeah I see what you mean and even attempted it, but I wish it was just that. But it's not.

Previously, when I added forums and containers the vocabulary (that I foolishly deleted) took care of automatically creating terms for them.

When I made my own ‘forum’ vocabulary, it didn’t do the above, as I was hoping.

I’m just hoping there is a way I can get that process back, so that when I do switch on the module forum, it automatically creates the vocabulary for me.

I’m just surprised that drupal is being so stubborn, that just by deleting something it refuses to create it automatically again as it always did.

Know how to get that feature back?

vm’s picture

it will not auto-regenerate. I"ve helped a user in this thread (http://drupal.org/node/84180#comment-155583) with same exact problem. youll have to recreate the forum vocabulary, then recreate your categories and forums.

you can install a test board with a fresh intstall and double check exactly whats on the fresh install when forum.module is enabled and duplicate the vocabulary, using the fresh installation as the example.

There is some very helpful information at the end of that thread, with regards to orphaned forums which may be of use also.

jason342’s picture

Ok, I like the idea of comparing the fresh install to my current one, but what do I compare exactly, which file in particular?

As I mentioned, I’ve already replaced the forum module with a new one, but the problem was still the same, so I can assume forum module is not where the problem lies.

Thanks.

drawk’s picture

It won't be a file, it will be an entry in your database.

---
www.whatwoulddrupaldo.org

jason342’s picture

That sounds scary, is not as simple as replace this code with this code is it?

How difficult of a process is it?

vm’s picture

depends on how often youve been inside the guts of your db.
you are running out of options short of a fresh installation.

no its not as simple as replace this code with this. sorry.
you'll have to view the differences in the two structures, and mimic one from the other.

if all of this is that scary, i highly suggest a fresh installation of the DB. dropping all tables out of the one you have now, reimporting a fresh .mysql file and begin a new with a new db. This will also disqualify any modules that you've installed and removed.

you'll reenable the modules you are keeping and be back quicker.

if you already have content on this site, then your task becomes more tedious. and shame shame for not developing on a dev site away from your production site : )

The above is the best way to avoid any and all "headaches" as you've called them. because you can then ask questions, about things and once you are up to speed on the method, you can implement it on your production site in a much shorter time, with a far greater sense of confidence.

The the DB clear will not remove any changes you've made to files. which is the benefit here.

jason342’s picture

I can't bring my self to say it but I think I’ve met my match with this problem. Which means starting over.

So i'll take the advice and start from absolute scratch, I’ve never worked with DB before so I think starting from scratch is a less painful process for me.

Thanks for helping. I really appreciate it.

vm’s picture

no problem and keep in mind : ) you know more today then you knew yesterday ; )

kenwen’s picture

I had exactly the same problem

After much stress this approach worked:

disable the module
drop the forum tables
enter the system table, drop the forum entries
enter the variables table, drop the forum entries

It worked for me, have no idea if it will work for you and I won't take responsbility if it sets off alien invasion or something...

dman’s picture

I think it comes down to one little variable.

after deleting and enabling and deleting in a different order and enabling again I managed to duplicate this unstable state.
(I'd seen it before in an earlier life)

As I guessed, it set a handle on the ID (not the name) of the 'Forum' vocab, and that wasn't being re-generated if it was already present (even if it had become invalid)

Soooo.
Quick fix:

variable_del('forum_nav_vocabulary');

No pain at all.
... you're welcome.

Was it too late for you jason? :-}

.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/

jason342’s picture

dman, thanks for you input, but can you please explain what I need to do exactly, such as where do I put that code and how do I do it?

<?php
variable_del('forum_nav_vocabulary');
?>

I have no idea, I appreciate if you explained it step by step because I’m still a novice.

If this that code is going to save me from starting over and weeks of work wasted then I am willing to try it.

Please elaborate further, thanks.

dman’s picture

I use the devel.module, which provides a console where I popped this, and a variable viewer which showed me what happened, but another quick way is:

Create new node (don't save)
Set content to php code. Disable wysiwyg if needed
Paste the above in the body
Preview
- the php code will execute, although you won't see anything yet.
discard the node, don't need to save it.
visit admin/forums
- this triggers the forum code to check if its parameters are correct
-- they are not so it will create the Forum vocab as needed
continue, create a new forum or container. The pages should work again as they are supposed to.

.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/

jason342’s picture

dman, everything works as before, thanks so much, that was a miracle cure!

I have a few questions for assurance and peace of mind, if you could answer them please.

So is everything back to normal as how it used to be? Meaning what I had deleted has been replaced with the exact same code (whatever code it was)? or did that code you gave me just tricked drupal/forum/categories/whichever into thinking everything is good and normal?

Meaning, should I worry about any consequences because of executing the code you gave me or will there be any mishaps with drupal in the future because of it, be it in the forum or any other part?

Or will everything be smooth sailing without any glitches in the forum, nodes, admin, etc…?

Because this is so good to be true that i'm worried about some sort of a drupal repercussion and backlash.

Thank you!

dman’s picture

at the point in time forum is installed, it creates a vocab with a unique ID and never expects that to change.
You deleted the vocab, but it didn't notice, and kept referring to the dead ID.

I told it to FORGET its old id. Thus it decided it was a good idea to make a new one. Note, this is NEW, a replacement for, but not identical with the original.

And yeah, it's ready to start pretty much as if it had just been installed fresh.

Don't run it again (or it will forget all handles on the forum you have now - and repairing that would be annoying) but I'm thinking it'll just work from now on.
Not that I've ever actually maintained a forum myself, I just know the way Drupal thinks about cached variables.

.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/

jason342’s picture

Thanks for the follow up, dman.

So, what was this actual hard code that I deleted?

And the code that o deleted not being there anymore, will it not cause any problems for me in the future?

Thanks

sepeck’s picture

dman,

Could you add this to the Troubleshooting-FAQ? This is something that comes up periodically.

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

dman’s picture

I've just made this page which summarizes the issue.

I'd think a small patch to forum.module should be made to check that its vocabulary exists and is valid before using it. That is a real solution.

.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/

sepeck’s picture

and you are right, that would be the fix.

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide