[BUGFIX] CLI context cannot write to backend log 22/27022/2
authorOliver Hader <oliver@typo3.org>
Thu, 23 Jan 2014 13:50:58 +0000 (14:50 +0100)
committerOliver Hader <oliver.hader@typo3.org>
Thu, 23 Jan 2014 13:55:34 +0000 (14:55 +0100)
The CLI context 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.

Note: Already merged in master (6.2) with different subject:
[BUGFIX] Functional tests cannot write to backend log

Fixes: #54849
Releases: 6.2, 6.1, 6.0
Change-Id: If6c572c62ab7022a4cab596fa4660dec754aee3c
Reviewed-on: https://review.typo3.org/27022
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php

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