Missing default values for guestbook table
| Project: | Guestbook |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Hello,
I am using Drupal 6.8 with some modules. All works fine.
I try to install the guestbook module, since Drupal 6.1, but I always get following error messages:
* user warning: Table 'royal.guestbook' doesn't exist query: SELECT COUNT(*) FROM guestbook WHERE recipient = 0 in D:\Inetpub\royal-scouts.com\sites\all\modules\guestbook\guestbook.module on line 341.
* user warning: Table 'royal.guestbook' doesn't exist query: SELECT g.*, u1.name, u1.data, u1.picture, u2.name as commentby FROM guestbook g LEFT JOIN users u1 ON g.author = u1.uid LEFT JOIN users u2 ON g.commentauthor = u2.uid WHERE g.recipient = 0 ORDER BY g.created DESC LIMIT 0, 20 in D:\Inetpub\royal-scouts.com\sites\all\modules\guestbook\guestbook.module on line 341.
What can be done to get the guestbook module working? Or is there an alternative module for a guestbook function.
Many thanks for any help.

#1
The error message indicates that Guestbook's database table is missing.
Please completely disable and uninstall the Guestbook module. Afterwards, re-install it.
#2
Thank you for your answer :)
Yes, I tried this already (disable and uninstall), because I have seen the hint.
But when I ativate the Guestbook module again, then comes:
user warning: BLOB/TEXT column 'message' can't have a default value query: CREATE TABLE guestbook ( `id` INT unsigned NOT NULL auto_increment, `recipient` INT unsigned NOT NULL DEFAULT 0, `author` INT unsigned NOT NULL DEFAULT 0, `anonname` VARCHAR(128) DEFAULT NULL, `anonemail` VARCHAR(128) DEFAULT NULL, `anonwebsite` VARCHAR(128) DEFAULT NULL, `message` TEXT NOT NULL DEFAULT '', `commentauthor` INT unsigned NOT NULL DEFAULT 0, `comment` TEXT NOT NULL DEFAULT '', `created` INT unsigned NOT NULL DEFAULT 0, PRIMARY KEY (id), INDEX recipient (recipient), INDEX commentauthor (commentauthor), INDEX created (created) ) /*!40100 DEFAULT CHARACTER SET UTF8 */ in D:\Inetpub\royal-scouts.com\includes\database.inc on line 515.
#3
I believe this error is already fixed in the latest development snapshot (both in 1.x and 2.x).
#4
Cool, I tried guestbook-6.x-2.x-dev.tar.gz and it works.
Many thanks for that hint :)
#5
Gustbook didn't send any error message after installing.
But when I try an entry in the Website-guestbook. then comes following error:
user warning: Field 'comment' doesn't have a default value query: INSERT INTO guestbook (anonname, anonemail, anonwebsite, author, recipient, message, created) VALUES('test', 'test@test.de', 'www.test.de', 0, 0, 'test text test text test text test text test text ', 1231199247) in D:\Inetpub\royal-scouts.com\sites\all\modules\guestbook\guestbook.module on line 531.
Can you help me?
#6
First iteration. Might already fix the bug, but needs a module update function to add the new default values for anon* columns.
#7
Thank you a lot for helping me and readers who have the same problems.
I have Windows running with IIS and I don't know how to make a patch.
Can you tell me how to make the patch?
FYI: Gustbook can be accessed with www.royal-scouts.com/guestbook
#8
You do not need to make a patch. Instead, download the patch that is attached to #6, and apply it to your Guestbook module. See http://drupal.org/patch/apply for further information.
#9
Thank you for the information. But my knowledge is not enough to patch to solve the problem. I tried it but couldn't get any result.
So I will wait until there is a new update of the module available which I can just update within drupal.
#10
The patch is good. Thanks.
#11
I am still getting the error, I have tried the normal and DEV versions, as well as uninstalling / re-installing.
error:
user warning: Table 'drupal.guestbook' doesn't exist query: SELECT COUNT(created) FROM guestbook WHERE recipient = 4 AND created > 1256526196 in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\drupal\sites\all\modules\guestbook\guestbook.module on line 1004.