Needs work
Project:
AntiSpam
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Oct 2012 at 23:50 UTC
Updated:
29 Nov 2012 at 20:41 UTC
Jump to comment: Most recent file
The date column in the antispam_counter table was changed in drupal 7.
'date' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
Previously it was of datetime type. The module update hook is missing that take care of this. Without this update, you cannot post new comments, as it errors out.
Attached is a patch that provides the upgrade hook.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | antispam_counter_date-3.patch | 1.08 KB | ttkaminski |
| #1 | antispam_counter_date-2.patch | 1.04 KB | ttkaminski |
| antispam_counter_date.patch | 914 bytes | ttkaminski |
Comments
Comment #1
ttkaminski commentedHere's an improved patch that checks to see if the date column is already an int, if so, then it ignores the change to the table. Needed if you already have the proper schema installed.
Comment #2
jody lynnPatch needs work.
I don't like that there's a state in the middle of the function where data has been deleted from the database. What if the code stops in the middle of the function? You should add a new column, insert the changed values, then delete the old field and rename the new one.
Comment #3
ttkaminski commentedHere's an UNTESTED patch that does that. Unfortunately I didn't have a database I could quickly test this against. But the changes were straight forward, so it should work.