I recently upgraded from D6 to D7 and users could no longer post to the shoutbox. The old messages survived the upgrade just fine, but no one could post new shouts.
After taking a bit of a poke around, I discovered that {shoutbox}.hostname didn't have a default and wasn't being updated when the 'shout' button was being pressed. I manually went into the database and added 'localhost' as the default for the field.
I suspect this isn't an issue on NEW installs of the module, as I can see the install schema includes the default, but will only hit folks who upgrade shoutbox from D6 to D7.
Anyways, this is resolved for me, just wanted to leave a note here for the developer.
Thanks for your hard work!
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | shoutbox-hostname-default-value-2193753.patch | 627 bytes | yan |
Comments
Comment #1
vitalblue commentedHi there,
I checked your comment but I was unable to reproduce that.
By default in shoutbox table the value is localhost so if you can give me more details for that I would glad.
'hostname' => array(
'type' => 'varchar',
'length' => 255,
'default' => 'localhost',
'not null' => TRUE,
'description' => 'The hostname where the post originated.',
),
Thanks a lot for your report
Comment #2
ynohtna commentedThanks for that. I just upgraded from Drupal 6.33 to 7.31 and I had this exact issue when upgrading the shoutbox (I only disabled, installed D7 version of shoutbox and enabled)
I was getting this in the log when trying to submit a shout
PDOException: SQLSTATE[HY000]: General error: 1364 Field 'hostname' doesn't have a default value: INSERT INTO {shoutbox} (uid, nick, shout, module, moderate, created, changed, sid) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7); Array ( [:db_insert_placeholder_0] => 1 [:db_insert_placeholder_1] => ynohtna [:db_insert_placeholder_2] => test [:db_insert_placeholder_3] => shoutbox [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => 1409526721 [:db_insert_placeholder_6] => 1409526721 [:db_insert_placeholder_7] => gfpCn_ZnWdGB-eHGz0U62IiicjSi6rB1M__-akd1WwU ) in drupal_write_record()
When to look at shoutbox table and there is a hostname field where null is not allowed but there is also no default set.
Putting the default to 'localhost' as described above got my shouts working.
So the upgrade process should have a script to put 'localhost' or something in the default value for shoutbox.hostname
Comment #3
yan commentedI experienced the same problem on a D6->D7 upgrade. I created an update hook #7000 to add a default value to the hostname column, see attached patch against 7.x-1.x-dev. It solves the problem in my case.
Please review.
Comment #4
vitalblue commentedpatch applied
Thanks a lot
Comment #5
vitalblue commented