protected function prepareContextForTypoScriptObject(AbstractTypoScriptObject $typoScriptObject, $typoScriptPath, $typoScriptConfiguration, $cacheContext) { if ($cacheContext['cacheForPathDisabled'] === true) { $contextArray = $this->getCurrentContext(); $newContextArray = []; foreach ($cacheContext['configuration']['context'] as $contextVariableName) { if (isset($contextArray[$contextVariableName])) { $newContextArray[$contextVariableName] = $contextArray[$contextVariableName]; } } } if (isset($typoScriptConfiguration['__meta']['context'])) { $newContextArray = isset($newContextArray) ? $newContextArray : $this->getCurrentContext(); foreach ($typoScriptConfiguration['__meta']['context'] as $contextKey => $contextValue) { $newContextArray[$contextKey] = $this->evaluateInternal($typoScriptPath . '/__meta/context/' . $contextKey, self::BEHAVIOR_EXCEPTION, $typoScriptObject); } } if (isset($newContextArray)) { $this->pushContextArray($newContextArray); return true; } return false; }