[BUGFIX] Functional tests cannot write to backend log 97/26697/2
authorOliver Hader <oliver@typo3.org>
Wed, 8 Jan 2014 19:23:17 +0000 (20:23 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Wed, 8 Jan 2014 19:35:11 +0000 (20:35 +0100)
Functional test cases cannot write to the backend log. The
log entry also has an information about the currently used
IP address, which is taken from the environment variable
REMOTE_ADDR. In a CLI disposal this value is NULL and cannot
be stored in the database, since the accordant sys_log.IP
field does not support NULL values.

Fixes: #54849
Releases: 6.2
Change-Id: If6c572c62ab7022a4cab596fa4660dec754aee3c
Reviewed-on: https://review.typo3.org/26697
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php

index c39e792..6709c63 100644 (file)
@@ -2095,7 +2095,7 @@ class BackendUserAuthentication extends \TYPO3\CMS\Core\Authentication\AbstractU
                        'log_data' => serialize($data),
                        'tablename' => $tablename,
                        'recuid' => intval($recuid),
-                       'IP' => GeneralUtility::getIndpEnv('REMOTE_ADDR'),
+                       'IP' => (string) GeneralUtility::getIndpEnv('REMOTE_ADDR'),
                        'tstamp' => $GLOBALS['EXEC_TIME'],
                        'event_pid' => intval($event_pid),
                        'NEWid' => $NEWid,