Token storage in DB means that length for some of these goes beyond the current 255 character limit on varchar.

Length is set in includes/webform.emails.inc

    $form[$field . '_custom'] = array(
      '#type' => 'textfield',
      '#size' => 40,
      '#default_value' => (!is_numeric($email[$field]) && $email[$field] != 'default') ? $email[$field] : NULL,
      '#maxlength' => $field == 'email' ? 500 : 255,
    );

($field would = 'subject' - in this case - the other 2 possibilities are from_name & from_address - I'm unsure as to whether they could wind up blowing out with tokens)

& in the schema / DB field itself.

Comments

torrance123’s picture

Version: 7.x-4.0-beta1 » 7.x-4.x-dev
Status: Active » Needs review
StatusFileSize
new3.51 KB

I agree — it seems unnecessary to limit the subject line to 255 characters, especially if we're using verbose tokens.

Please see attached patch against the 7.x-4.x branch which changes the database columns to type 'TEXT' (thus matching the email field) and increases the #maxlength property to 500.

xurizaemon’s picture

Title: Email subject length is too restrictive now that tokens are stored in this field » Convert subject, from_name, from_email, email fields to text to allow room for token storage
Issue summary: View changes

+1. NB the limit on emails doesn't relate to RFC, since we store multiple emails in the same field comma separated.

* #277581: Send emails with a custom/templated body (and subject, to addresses and from addresses) - 255 char limit on other fields
* #848386: Extend limit of 128 characters for "To:" addresses in custom email - 500 char limit on emails

torrance123’s picture

Status: Needs review » Reviewed & tested by the community

Seems all good.

quicksketch’s picture

Status: Reviewed & tested by the community » Fixed

Thanks guys! Tested and works fine here too. Committed to 7.x-4.x branch as-is.

Status: Fixed » Closed (fixed)

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

fenstrat’s picture

Version: 7.x-4.x-dev » 8.x-4.x-dev
Assigned: Unassigned » fenstrat
Status: Closed (fixed) » Patch (to be ported)

Needs porting to 8.x-4.x.

fenstrat’s picture

Version: 8.x-4.x-dev » 7.x-4.x-dev
Assigned: fenstrat » Unassigned
Status: Patch (to be ported) » Fixed

Committed and pushed 06b32c6 to 8.x-4.x.

  • Commit e020a34 on 8.x-4.x by fenstrat:
    Issue #2179405 by torrance123 | eileenmcnaughton: Convert subject,...

Status: Fixed » Closed (fixed)

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