While migrating from D6 to D7, the function simplenews_update_7000() threw an error because I was trying to insert a string with 71 characters into a field which only allowed 64 characters. I personally feel that 64 is too short a limit, especially in languages which are more verbose than English (in my use case, French). Further, this will break the upgrade path for anyone with a longer from_name in D6. So, I propose reverting #1498194: Missing length validation on from_name, changing the schema of the table simplenews_category, and changing simplenews_update_7000() accordingly.

If you really believe that this field should be limited to 64 characters, simplenews_update_7000() should truncate this field and print a warning instead of throwing an error.

Files: 
CommentFileSizeAuthor
#4 simplenews-longer-from_name-1585992-4.patch4.49 KBmvc
PASSED: [[SimpleTest]]: [MySQL] 1,798 pass(es).
[ View ]
#1 simplenews-longer-from_name-1585992-1.patch1.95 KBmvc
PASSED: [[SimpleTest]]: [MySQL] 1,794 pass(es).
[ View ]

Comments

Status:Needs work» Needs review
StatusFileSize
new1.95 KB
PASSED: [[SimpleTest]]: [MySQL] 1,794 pass(es).
[ View ]

The email + display name shouldn't be longer than 255 characters, or it will be dropped by SMTP, see http://msdn.microsoft.com/en-us/library/cc765823.aspx.

Not sure if this would be a problem, I guess 128 should work...

Oh, and even if we increase the limit, it wouldn't hurt to ensure that the existing strings aren't longer. variables have no length limit and who knows what people added in there. Maybe other things as well?

StatusFileSize
new4.49 KB
PASSED: [[SimpleTest]]: [MySQL] 1,798 pass(es).
[ View ]

i didn't know about that limit, but if the name is limited to 128 and the address to 64 then we'll still be fine.

here's a version which actually checks the lengths of strings in D6 variables, truncates them to avoid fatal errors, and prints a useful warning.

Status:Needs review» Fixed

Thanks, commited.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.