I install the forum module, good work, when i post my first forum i get and when i reply to the forum post i get this error

user warning: Unknown column 'TotalPostCount' in 'field list' query: UPDATE F_Forums SET TotalPostCount='1' WHERE ForumID=1 in /home/web/dwebmasterxcom/includes/database.mysql.inc on line 121.

I am using drupal 4.7.4

You can see my test site at
http://www.morocco.co.ma/uieforum

Comments

Mike_javelin’s picture

I have the exact same problem having made a fresh install today.
All going well until this point.
The posts and replies do stick though it's just I get the warning.

Mike_javelin’s picture

Upgraded from 4.7.2 to 4.7.4 (forgot earlier) and the problem remains.

# user warning: Unknown column 'TotalPostCount' in 'field list' query: UPDATE F_Forums SET TotalPostCount='1' WHERE ForumID=2 in.............bla bla bla

daniel.hunt’s picture

There is an extra field added by the .install file - but it isn't added by default by drupal (why it doesn't cycle through the damned updates I don't know)
When you go to your modules page there's a link to "update.php" - I've been told that this will solve that for you, but I haven't tried it myself.

If you give it a go, let me know how it runs for you!

toma’s picture

I try mmysite.com/update.php but still have the same error

daniel.hunt’s picture

Seriously - this whole .install thing is driving me insane. If there are updates to be run, it should bloody run the things *angry*

Try these queries - it should fix it for you!

ALTER TABLE F_Forums ADD COLUMN TotalThreadCount int(12) DEFAULT '0';
ALTER TABLE F_Forums ADD COLUMN TotalPostCount int(12) DEFAULT '0';

Daniel

toma’s picture

thanks for your reply

seems not to work

user warning: Unknown column 'TotalPostCount' in 'field list' query: UPDATE F_Forums SET TotalPostCount='1' WHERE ForumID=1 in /home/web/dwebmasterxcom/includes/database.mysql.inc on line 121.

By the way anonymous users can't access my forum, even if i set the access control to the module to "access forum"

www.morocco.co.ma/forum

Mike_javelin’s picture

Great work Guys - forum is great :)

Lisk’s picture

I am using 4.7 and I have tried running the update.php script but I am still getting this error when I try to post something:

user warning: Unknown column 'TotalPostCount' in 'field list' query: UPDATE F_Forums SET TotalPostCount='1' WHERE ForumID=2 in /home/liskidde/public_html/etsyglass/main/includes/database.mysql.inc on line 121.
user warning: Unknown column 'TotalPostCount' in 'field list' query: UPDATE F_Forums SET TotalPostCount='1' WHERE ForumID=1 in /home/liskidde/public_html/etsyglass/main/includes/database.mysql.inc on line 121.
user warning: Unknown column 'TotalThreadCount' in 'field list' query: UPDATE F_Forums SET TotalThreadCount='1' WHERE ForumID=2 in /home/liskidde/public_html/etsyglass/main/includes/database.mysql.inc on line 121.
user warning: Unknown column 'TotalThreadCount' in 'field list' query: UPDATE F_Forums SET TotalThreadCount='1' WHERE ForumID=1 in /home/liskidde/public_html/etsyglass/main/includes/database.mysql.inc on line 121.

Lisk’s picture

Also the images are broken (e.g. report post, etc)

daniel.hunt’s picture

I swear to god, the new drupal install stuff will drive me insane. If there's an update to run, it should bloody well run it when installing :/
I'll have a look for you, but I'm off on holidays for 2 and a half weeks tomorrow, so it's unlikely I'll get anything done until I get back!

Daniel

filoktetes’s picture

I had the same problem. But I ran the ALTER TABLE queries above, and everything worked fine afterwards.
I had made some test posts, which I deleted, though, and then I got negative total thread and total post counts.
I fixed this simply by resetting the counters in the admin area.

filoktetes’s picture

I had the same problem. But I ran the ALTER TABLE queries above, and everything worked fine afterwards.
I had made some test posts, which I deleted, though, and then I got negative total thread and total post counts.
I fixed this simply by resetting the counters in the admin area.

daniel.hunt’s picture

Assigned: toma » daniel.hunt
Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)