Hallo fiedsch,
danke für Deine Antwort. Aber greift diese Formular-Validierung denn überhaupt, wenn ich ein normales NewsletterSubscribeModul habe? Im ModuleSubscribe.php wird die valide E-Mail-Adresse nicht über das Formularfeld, sondern in der Methode addRecipient() geprüft. Dort greift er dann auf die isValidEmail() der System.php zu.
PHP-Code:
protected function addRecipient()
{
$arrChannels = $this->Input->post('channels');
$arrChannels = array_intersect($arrChannels, $this->nl_channels); // see #3240
// Check the selection
if (!is_array($arrChannels) || empty($arrChannels))
{
$_SESSION['SUBSCRIBE_ERROR'] = $GLOBALS['TL_LANG']['ERR']['noChannels'];
$this->reload();
}
$varInput = $this->idnaEncodeEmail($this->Input->post('email', true));
// Validate e-mail address
if (!$this->isValidEmailAddress($varInput))
{
$_SESSION['SUBSCRIBE_ERROR'] = $GLOBALS['TL_LANG']['ERR']['email'];
$this->reload();
}
Daher meine Idee, die System.php zu erweitern, um das global abfangen zu können. Meine eigenen generierten Formulare greifen dann über den $GLOBALS['TL_HOOKS']['validateFormField'][] ebenfalls auf diese Methode der System.php zu.
Viele Grüße
Christian
Lesezeichen