A client of mine recently contacted me saying the comments on their site are not working any longer. When you try to leave a comment (anonymous is allowed, and has always worked fine) it now says
"Error - The website encountered an unexpected error. Please try again later."
So I looked in the error log, and the entire 25 pages only took me back 2 days worth of errors, but it was almost entirely filled with every other line being this error, or some very slight variation of it:
"PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'entity_id' cannot be null: INSERT INTO {field_data_comment_body} (entity_type, entity_id, revision_id, bundle, delta, language, comment_body_value, comment_body_format) 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] => comment [:db_insert_placeholder_1] => [:db_insert_placeholder_2] => [:db_insert_placeholder_3] => comment_node_article [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => und [:db_insert_placeholder_6] => http://cheapviagra50mg.net/ cheap viagra http://prix-viagra-generique.net/ commander viagra http://comprarviagragenerico25mg.net/ viagra generico http://prezzoviagragenerico.net/ acquisto viagra [:db_insert_placeholder_7] => plain_text ) in field_sql_storage_field_storage_write() (line 424 of /home/p1brand/p1brand.com/modules/field/modules/field_sql_storage/field_sql_storage.module)."
--
Now it looks like of course an attempted spam comment post or whatever, so I adjusted the site settings to not allow any users to be created except by Administrator... And if I can "FIX" whatever is going on that is breaking comments, then I'll add in a captcha or something, but how do I fix being able to actually make new REAL comments?
Also, another weird thing, for example on http://www.p1brand.com/comment/reply/236 - it shows there *should* be 26 comments, yet, none display.
Also when I go to "/admin/content/comment" on the site, there are no comments here either.
Did something/someone hack in and delete all comments? Or what? (Also if they did, why would the node still think it has 26 comments?)
Hopefully I didn't miss any pertinent information here, but is someone able to decipher that error message to help direct me a little bit here? TIA,
~SS