[BUGFIX] PHP codeinspection returns errors 77/58677/2
authorStanislas Rolland <typo3@sjbr.ca>
Tue, 23 Oct 2018 19:23:20 +0000 (15:23 -0400)
committerStanislas Rolland <typo3@sjbr.ca>
Tue, 23 Oct 2018 19:24:53 +0000 (21:24 +0200)
Resolves: #85925
Change-Id: I7d0be3487fbcbc2661536a82d95129aca0e35fe6
Reviewed-on: https://review.typo3.org/58677
Reviewed-by: Stanislas Rolland <typo3@sjbr.ca>
Tested-by: Stanislas Rolland <typo3@sjbr.ca>
ChangeLog
Classes/Domain/Data.php

index 71bbbc6..cdf2a92 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2018-10-23 Stanislas Rolland  <typo3(arobas)sjbr.ca>
+       * Resolves #85925: PHP codeinspection returns errors
+
 2018-04-04 Stanislas Rolland  <typo3(arobas)sjbr.ca>
        * Resolves #84605: PHP Warning: count() in SJBR\SrFeuserRegister\Request\Parameters
 
index 33f2834..8cdeed0 100644 (file)
@@ -34,6 +34,7 @@ use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\MathUtility;
 use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
+use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
 
 /**
  * Data store functions
@@ -369,7 +370,7 @@ class Data
                        $adminFieldList = 'username,password,name,disable,usergroup,by_invitation,tx_srfeuserregister_password';
                }
                if (trim($this->conf['addAdminFieldList'])) {
-                       $adminFieldList .= ',' . trim($conf['addAdminFieldList']);
+                       $adminFieldList .= ',' . trim($this->conf['addAdminFieldList']);
                }
                // Honour Address List (tt_address) configuration settings
                if ($this->theTable === 'tt_address' && ExtensionManagementUtility::isLoaded('tt_address')) {
@@ -1250,12 +1251,12 @@ class Data
                        }
                        if ($GLOBALS['TCA'][$this->theTable]['ctrl']['fe_cruser_id']) {
                                $field = $GLOBALS['TCA'][$this->theTable]['ctrl']['fe_cruser_id'];
-                               $dataArr[$field] = (int)$this->cObj->getTypoScriptFrontendController()->fe_user->user['uid'];
+                               $dataArr[$field] = (int)$this->getTypoScriptFrontendController()->fe_user->user['uid'];
                                $extraList .= ',' . $field;
                        }
                        if ($GLOBALS['TCA'][$this->theTable]['ctrl']['fe_crgroup_id']) {
                                $field = $GLOBALS['TCA'][$this->theTable]['ctrl']['fe_crgroup_id'];
-                               list($dataArr[$field]) = explode(',', $this->cObj->getTypoScriptFrontendController()->fe_user->user['usergroup']);
+                               list($dataArr[$field]) = explode(',', $this->getTypoScriptFrontendController()->fe_user->user['usergroup']);
                                $dataArr[$field] = (int)$dataArr[$field];
                                $extraList .= ',' . $field;
                        }
@@ -2135,4 +2136,12 @@ class Data
        {
                return $this->theTable;
        }
+
+    /**
+     * @return TypoScriptFrontendController
+     */
+    protected function getTypoScriptFrontendController()
+    {
+        return $GLOBALS['TSFE'];
+    }
 }
\ No newline at end of file