Actions
Bug #71464
closedMisspelling of the variable field prevents the use of dynamical subject in form postprocessing
Start date:
2015-11-10
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:
Description
Subject of the bug is the postprocessing function of the form sysext to send the emails.
file:
sysext/form/Classes/PostProcess/MailPostProcessor.php
According to the code, if there is no "subject" defined but a form field is defined as the subject field we use the data from the form field instead.
line: 139
protected function setSubject() { if (isset($this->typoScript['subject'])) { $subject = $this->typoScript['subject']; } elseif ($this->getTypoScriptValueFromIncomingData('subject') !== NULL) { $subject = $this->getTypoScriptValueFromIncomingData('subject'); } else { $subject = 'Formmail on ' . GeneralUtility::getIndpEnv('HTTP_HOST'); } $subject = $this->sanitizeHeaderString($subject); $this->mailMessage->setSubject($subject); }
The part
} elseif ($this->getTypoScriptValueFromIncomingData('subject') !== NULL) {
calls the same variable as in the if condition below, resulting in the condition always being false.
line: 482
protected function getTypoScriptValueFromIncomingData($propertyName) { if (empty($this->typoScript[$propertyName])) { return NULL; } ......
According to other name definitions in the same class the part should be changed to
protected function setSubject() { if (isset($this->typoScript['subject'])) { $subject = $this->typoScript['subject']; } elseif ($this->getTypoScriptValueFromIncomingData('subjectField') !== NULL) { $subject = $this->getTypoScriptValueFromIncomingData('subjectField'); } else { $subject = 'Formmail on ' . GeneralUtility::getIndpEnv('HTTP_HOST'); } $subject = $this->sanitizeHeaderString($subject); $this->mailMessage->setSubject($subject); }
this way "subjectField" can be defined as the field to hold the subject value
Updated by Björn Jacob about 9 years ago
- Status changed from New to Needs Feedback
- Assignee set to Dimitri Lavrenük
Updated by Dimitri Lavrenük about 9 years ago
Exactly this problem has been adressed and fixed in the commit. Thank you for the fast feedback, the issue can be closed.
Updated by Georg Ringer about 9 years ago
- Status changed from Needs Feedback to Closed
closed as requested
Actions