Skip to content

Commit

Permalink
[TASK] Return full userTS in getTSConfig()
Browse files Browse the repository at this point in the history
By making the first argument $objectString optional in
BackendUserAuthentication->userTSConfig(), we allow the method to
act as a true getter that returns the full user TSconfig array.

This avoids calls to the public property ->userTS, which will be set
to protected in master with another patch.

This patch request is for both master and v8 to simplify life of
extension developers who want to keep an extension compatible
with v8 and v9, without throwing deprecations in v9.

Resolves: #84982
Releases: master, 8.7
Change-Id: I971fcaf4a402b762add4c469650c62b059264d8f
Reviewed-on: https://review.typo3.org/56938
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
  • Loading branch information
lolli42 committed May 12, 2018
1 parent 4078aba commit d7a68b8
Showing 1 changed file with 7 additions and 2 deletions.
Expand Up @@ -1154,15 +1154,20 @@ public function workspaceSwapAccess()
}

/**
* Returns fully parsed user TSconfig array.
*
* Returns the value/properties of a TS-object as given by $objectString, eg. 'options.dontMountAdminMounts'
* Nice (general!) function for returning a part of a TypoScript array!
*
* @param string $objectString Pointer to an "object" in the TypoScript array, fx. 'options.dontMountAdminMounts'
* @param array|string $config Optional TSconfig array: If array, then this is used and not $this->userTS. If not array, $this->userTS is used.
* @return array An array with two keys, "value" and "properties" where "value" is a string with the value of the object string and "properties" is an array with the properties of the object string.
*/
public function getTSConfig($objectString, $config = '')
public function getTSConfig($objectString = '', $config = '')
{
if (empty($objectString) && empty($config)) {
return $this->userTS;
}

if (!is_array($config)) {
// Getting Root-ts if not sent
$config = $this->userTS;
Expand Down

0 comments on commit d7a68b8

Please sign in to comment.