The current implementation of the forward.module allows the subject field to be set as a variable supporting a couple custom tokens (site name, user name). However, there are a number of use cases (such as included the title of a node in the subject or a particular date) that are difficult to support given this structure.
I changed the subject form element to a "value" instead of an "item" to expose it to the submit handler and then assigned it in the submit handler directly from that passed form value (since it was already initially set during form construction). Since the forward form page wants to display the subject I created another form element with type "item" for display purposes only.
This allows custom modules to modify the subject line using form_alter. A possible example modification in form_alter could be:
$form['message']['subject']['#value'] = t('Drupal Site') . ': '. $form['node']['#value']->title;
$form['message']['subject_display']['#value'] = $form['message']['subject']['#value'];
| Comment | File | Size | Author |
|---|---|---|---|
| forward_form_alterable_subject.patch | 1.14 KB | populist |
Comments
Comment #1
john.oltman commentedVersion 5.x is no longer supported. Please upgrade to version 6.x or 7.x and reopen the issue there if the problem still occurs in one of those releases.