[BUGFIX] Translated mailform should use localized email
authorMichael Stucki <michael.stucki@typo3.org>
Sun, 15 Jan 2012 22:09:10 +0000 (23:09 +0100)
committerTolleiv Nietsch <info@tolleiv.de>
Fri, 10 Feb 2012 07:44:10 +0000 (08:44 +0100)
In case mailforms are translated the email adress from the
translated record is ignored.

Change-Id: I184e7b96fe5a0405e3bed6546d4461cd44282ed6
Fixes: #17061
Releases: 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/7817
Reviewed-by: Stefan Rotsch
Tested-by: Stefan Rotsch
Reviewed-by: Thomas Layh
Tested-by: Thomas Layh
Reviewed-by: Wouter Wolters
Reviewed-by: Tolleiv Nietsch
Tested-by: Tolleiv Nietsch
typo3/sysext/cms/tslib/content/class.tslib_content_form.php

index ce8219b..7b44f10 100644 (file)
@@ -797,8 +797,12 @@ class tslib_content_Form extends tslib_content_Abstract {
                        if ($location == 'HTTP_POST_VARS' && isset($_POST['locationData'])) {
                                $locationData = t3lib_div::_POST('locationData');
                        } else {
-                                       // locationData is [hte page id]:[tablename]:[uid of record]. Indicates on which page the record (from tablename with uid) is shown. Used to check access.
-                               $locationData = $GLOBALS['TSFE']->id . ':' . $this->cObj->currentRecord;
+                                       // locationData is [the page id]:[tablename]:[uid of record]. Indicates on which page the record (from tablename with uid) is shown. Used to check access.
+                               if (isset($this->data['_LOCALIZED_UID'])) {
+                                       $locationData = $GLOBALS['TSFE']->id . ':' . str_replace($this->data['uid'], $this->data['_LOCALIZED_UID'], $this->cObj->currentRecord);
+                               } else {
+                                       $locationData = $GLOBALS['TSFE']->id . ':' . $this->cObj->currentRecord;
+                               }
                        }
                        $hiddenfields .= '<input type="hidden" name="locationData" value="' . htmlspecialchars($locationData) . '" />';
                }