[BUGFIX] FlexFormNoTabsContainer: Fix usage of array_pop() 94/51694/2
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Wed, 8 Feb 2017 16:52:25 +0000 (17:52 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Wed, 15 Feb 2017 12:38:38 +0000 (13:38 +0100)
PHP’s `array_pop()` requires its argument being passed as reference,
but the result of `array_keys()` is directly used.
The result of `array_keys()` is now stored into a variable which gets
passed to `array_pop()`.

Resolves: #79686
Releases: master, 7.6
Change-Id: Icda3040abefbffad64e93acf0d7ae632ccee00bf
Reviewed-on: https://review.typo3.org/51694
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Classes/Form/Container/FlexFormNoTabsContainer.php

index 98c190e..7180ba0 100644 (file)
@@ -42,7 +42,8 @@ class FlexFormNoTabsContainer extends AbstractContainer
 
         // Flex ds was normalized in flex provider to always have a sheet.
         // Determine this single sheet name, most often it ends up with sDEF, except if only one sheet was defined
-        $sheetName = array_pop(array_keys($flexFormDataStructureArray['sheets']));
+        $flexFormSheetNames = array_keys($flexFormDataStructureArray['sheets']);
+        $sheetName = array_pop($flexFormSheetNames);
         $flexFormRowDataSubPart = $flexFormRowData['data'][$sheetName]['lDEF'] ?: [];
 
         // That was taken from GeneralUtility::resolveSheetDefInDS - no idea if it is important