Project

General

Profile

Actions

Bug #71464

closed

Misspelling of the variable field prevents the use of dynamical subject in form postprocessing

Added by Dimitri Lavrenük about 9 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Should have
Category:
Form Framework
Target version:
-
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

Actions #1

Updated by Björn Jacob about 9 years ago

  • Status changed from New to Needs Feedback
  • Assignee set to Dimitri Lavrenük

Please check out TYPO3 7 LTS which has been released a couple of minutes ago. See the code. The issue was fixed with this commit.

I think we can close this issue. Check it and please give us feedback. Thx.

Actions #2

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.

Actions #3

Updated by Georg Ringer about 9 years ago

  • Status changed from Needs Feedback to Closed

closed as requested

Actions

Also available in: Atom PDF