Closed (outdated)
Project:
Shoutbox
Version:
6.x-1.0
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
9 Feb 2009 at 15:04 UTC
Updated:
18 Mar 2016 at 11:11 UTC
Jump to comment: Most recent
If you try to use shoutbox with Postgres (at least version 8.3), shouts are not created (you get a listing of n/a) when you create them, and trying to "list all shouts" gives you an error of:
* warning: pg_query() [function.pg-query]: Query failed: ERROR: null value in column "hostname" violates not-null constraint in /home/chris/vijay/includes/database.pgsql.inc on line 139.
* user warning: query: INSERT INTO shoutbox (uid, nick, shout, url, moderate, created, changed, sid) VALUES (1, 'admin', 'I''m in charge here', 'www.chriscurvey.com', 0, 1234191751, 1234191751, '0e60b7b30e18414721c99e68c217712f') in /home/chris/vijay/sites/all/modules/shoutbox/shoutbox.module on line 27.
My solution to the problem was to make the "hostname" field nullable at line 666 in shoutbox.install. I guess another (maybe better) solution would be to add a default to that field.
Comments
Comment #1
disterics commentedWill fix this in the next release.
Comment #2
alek123 commentedI change shoutbox.module, line 666 to:
db_query("INSERT INTO {shoutbox} (uid, nick, shout, url, moderate, created, changed, hostname, sid) VALUES (%d, '%s', '%s', '%s', %d, %d, %d, '%s', '%s')", $user->uid, $form_state['values']['nick'], $form_state['values']['message'], $form_state['values']['url'], $moderate, $created, $created, ip_address(), session_id());I save ip_address() in that field, while the next version is realesed.
Thanks!!!
Alek
Comment #3
disterics commentedFinally managed to install postgresql on my mac and reproduce the problem. Problem is, we no longer user the ip_address column but we were keeping it to help identify anonymous users from previous versions.
I will update the schema to exclude this column and delete it from old installs.
Comment #4
slinc commentedI'm getting:
user warning: Unknown column 'url' in 'field list' query: INSERT INTO shoutbox (uid, nick, shout, url, moderate, created, changed, sid) VALUES (1, 'admin', 'Test', '', 0, 1275674550, 1275674550, '46d038d21f20bb65692133dbbf7dbd8b') in /home2/.../sites/all/modules/shoutbox/shoutbox.module on line 666.
After seeing a listing of ": n/a".
This happened on mysql.
I would use the version 2.0, but there is now way I can put the input field below the shouts. Could anyone please give me advice on how to fix this problem, or do so with the 2.0 version?
Thanks!
Comment #5
vitalblue commented