Closed (duplicate)
Project:
Mail Comment
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
17 Mar 2011 at 12:54 UTC
Updated:
29 Jun 2012 at 10:17 UTC
If the email has a subject that is more than 64 characters, the comment is not created, and the following error appears:
Data too long for column 'subject' at row 1 query: INSERT INTO comments ..... in ...\modules\comment\comment.module on line 764.
The comments column subject is varchar(64), while the node title is varchar(255). Perhaps this should be addressed by the mailcomment_extras filtering. Thanks for any help.
Roman
Comments
Comment #1
intu.cz commentedI did two things, in a very makeshift way, as a quick workaround:
in mailcomment.module after line 273 inserted:
$message->subject = mb_substr($message->subject, 0, 60)."...";so that messages have a trimmed subject in the first place. After this I discovered that email clients add Re: and whatever else to the subject so I went to the mailhandler.retrieve.inc and inserted
$header->subject = mb_substr($header->subject, 0, 55)."...";after line 372.
Hopefully, this should be taken into account in a better way: if the email is a comment, than subject can have only 64 chars.
Comment #2
BarisW commentedYou can also work around this without having to patch the module, using hook_comment_insert:
As this problem still occurs in 7.x, I've changed the version.
Comment #3
BarisW commentedHmm, my code above does not seem to work. The problem actually lies in feeds_comment_processor, not in Mail Comment. I've created an issue in that module and attached a patch. Marking this issue as duplicate.