Issue Bug Closed

#95464Invalid email address notification in BE form doesn't show correctly

Robert von Hackwitz 10/04/21, 13:04 updated 10/13/21, 09:37

Description

If a field in a BE form has the value “email” as configuration “eval” and an invalid email address is entered, the error message is not displayed correctly (see screenshot)
the checkValue_input_ValidateEmail method is in fact currently like this

protected function checkValue_input_ValidateEmail($value, &$set, string $table, $id)
    {

        if (GeneralUtility::validEmail($value)) {
            return;
        }

        $set = false;
        $this->log(
            $table,
            $id,
            SystemLogDatabaseAction::UPDATE,
            0,
            SystemLogErrorClassification::SECURITY_NOTICE,
            '"%s" is not a valid e-mail address.',
            -1,
            [$this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:error.invalidEmail'), $value]
        );
    }

while it should be like this

protected function checkValue_input_ValidateEmail($value, &$set, string $table, $id)
    {
        if (GeneralUtility::validEmail($value)) {
            return;
        }

        $set = false;
        $this->log(
            $table,
            $id,
            SystemLogDatabaseAction::UPDATE,
            0,
            SystemLogErrorClassification::SECURITY_NOTICE,
            $this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:error.invalidEmail'),
            -1,
            [$value]
        );
    }

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.