Feature #3293

support for legacy TypoScript (with . at end)

Added by Sebastian Kurfuerst about 6 years ago. Updated almost 5 years ago.

Status:Resolved Start date:2009-05-14
Priority:Should have Due date:
Assigned To:- % Done:

100%

Category:-
Target version:1.0.0 alpha 3
Has patch:

Description

I HATE IT!!! I just entered 20 lines, but now I will just solve the bug...

fluid_3293.patch Magnifier - adds utility class and simple testcase (4.3 kB) Christian Müller, 2009-06-08 17:50

History

#1 Updated by Sebastian Kurfuerst about 6 years ago

  • Target version changed from 1.0.0 alpha 1 to 1.0
  • Branch set to v4

#2 Updated by Sebastian Kurfuerst about 6 years ago

Problem:
All TypoScript settings are made available under $this->settings inside the Controller, and as well as {settings} inside the template. To be more close to FLOW3 and because the "." (dot) is the separator in Object Accessors, we needed to strip the trailing "." in TypoScript configuration away.
Thus, when one writes the TypoScript:
10 = TEXT
10.value = Hello
then, in classical TYPO3 v4, this gets converted to the following array:
array(
'10' => 'TEXT'
'10.' => array(
'value' => 'Hallo'
)
)
However, Extbase converts it to the following (because of the above reasons)
array(
'10' => array(
'value' => 'Hallo',
'_typoscriptNodeValue' => 'TEXT'
)
So, what happens is that the value of the actual TypoScript node is pushed down into its substructure.
This works really well, and solves most cases, but imagine the following case:
Inside your ViewHelper, you expect a configuration for a cObject which you'll render using the classical tslib_cObj. Thus, you'll need the "classical" TYPO3 v4 syntax (with trailing dot), but Extbase only provides you the 2nd syntax with _typoscriptNodeValue.

Job description:
Write a helper method you can call inside your custom ViewHelper which converts the "Extbase" TypoScript to "classical" TypoScript by re-introducing the "." where needed and remove the _typoscriptNodeValue.
Test it with unit tests.
I propose that the class should be called Tx_Extbase_Utility_TypoScript.

#3 Updated by Sebastian Kurfuerst about 6 years ago

  • Status changed from New to Accepted

Christian Müller takes over this job!

#4 Updated by Christian Müller about 6 years ago

Here we go! CLA is on the way...

#5 Updated by Sebastian Kurfuerst about 6 years ago

  • Status changed from Accepted to Resolved
  • % Done changed from 0 to 100

committed. Thanks and sorry for the long delay!

Greets,
Sebastian

#6 Updated by Robert Lemke about 6 years ago

  • Target version changed from 1.0 to 1.0.0 alpha 3

Also available in: Atom PDF