Commit d0ecd223 authored by Christian Kuhn's avatar Christian Kuhn
Browse files

[TASK] Return full userTS in getTSConfig()

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/56937


Reviewed-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarMathias Schreiber <mathias.schreiber@typo3.com>
Tested-by: default avatarMathias Schreiber <mathias.schreiber@typo3.com>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 19d916ad
......@@ -1190,15 +1190,20 @@ class BackendUserAuthentication extends AbstractUserAuthentication
}
/**
* 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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment