‪TYPO3CMS  ‪main
TYPO3\CMS\Backend\Form\FormDataProvider\TcaFlexProcess Class Reference
Inheritance diagram for TYPO3\CMS\Backend\Form\FormDataProvider\TcaFlexProcess:
TYPO3\CMS\Backend\Form\FormDataProviderInterface

Public Member Functions

array addData (array $result)
 

Protected Member Functions

 scanForInvalidSectionContainerTca (array $result, string $fieldName)
 
 getSimplifiedDataStructureIdentifier (string $dataStructureIdentifier)
 
array getPageTsOfFlex (array $result, $fieldName, $flexIdentifier)
 
array modifyOuterDataStructure (array $result, $fieldName, $pageTsConfig)
 
array removeExcludeFieldsFromDataStructure (array $result, $fieldName, $flexIdentifier)
 
array removeDisabledFieldsFromDataStructure (array $result, $fieldName, $pageTsConfig)
 
array modifyDataStructureAndDataValuesByFlexFormSegmentGroup (array $result, $fieldName, $pageTsConfig)
 
array prepareNewSectionContainer (array $result, string $fieldName)
 
array modifySingleSheetInformation (array $dataStructure, array $pageTsOfSheet)
 
 getBackendUser ()
 

Detailed Description

Process data structures and data values, calculate defaults.

This is typically the last provider, executed after TcaFlexPrepare

Definition at line 29 of file TcaFlexProcess.php.

Member Function Documentation

◆ addData()

◆ getBackendUser()

TYPO3\CMS\Backend\Form\FormDataProvider\TcaFlexProcess::getBackendUser ( )
protected

◆ getPageTsOfFlex()

array TYPO3\CMS\Backend\Form\FormDataProvider\TcaFlexProcess::getPageTsOfFlex ( array  $result,
  $fieldName,
  $flexIdentifier 
)
protected

Determine TCEFORM.aTable.aField.matchingIdentifier

Parameters
array$result‪Result array
string$fieldName‪Handled field name
string$flexIdentifier‪Determined identifier
Returns
‪array Page TSconfig for this flex

Definition at line 202 of file TcaFlexProcess.php.

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaFlexProcess\addData().

◆ getSimplifiedDataStructureIdentifier()

TYPO3\CMS\Backend\Form\FormDataProvider\TcaFlexProcess::getSimplifiedDataStructureIdentifier ( string  $dataStructureIdentifier)
protected

Calculate a simplified (and wrong) data structure identifier. This is used to find pageTsConfig options of flex fields and exclude field definitions later, see methods below. If the data structure identifier is not type=tca based and if dataStructureKey is not as expected, fallback is "default"

Example pi_flexform with ext:news in tt_content:

  • ‪TCA config of pi_flexform ds_pointerfield is set to "list_type,CType"
  • ‪list_type in databaseRow is "news_pi1"
  • ‪CType in databaseRow is "list"
  • ‪The resulting dataStructureIdentifier calculated by FlexFormTools is then: {"type":"tca","tableName":"tt_content","fieldName":"pi_flexform","dataStructureKey":"news_pi1,list"}
  • ‪The resulting simpleDataStructureIdentifier is "news_pi1"
  • ‪The pageTsConfig base path used for flex field overrides is "TCEFORM.tt_content.pi_flexform.news_pi1", a full example path disabling a field: "TCEFORM.tt_content.pi_flexform.news_pi1.sDEF.settings\.orderBy.disabled = 1"
  • ‪The exclude path for be_user exclude rights is "tt_content:pi_flexform;news_pi1", a full example: tt_content:pi_flexform;news_pi1;sDEF;settings.orderBy

Notes: This approach is obviously limited. It is not possible to override flex form DS via pageTsConfig for other complex or dynamically created data structure definitions. And worse, the fallback to "default" may lead to naming clashes if two different data structures have identical sheet and field names. Also, the exclude field handling is limited and it is not possible to respect 'exclude' fields in flex form data structures if the dataStructureIdentifier is based on type="record" or manipulated by a hook in FlexFormTools. All that can only be solved by changing the pageTsConfig syntax referencing flex fields, probably by involving the whole data structure identifier and going away from this "simple" approach. For exclude fields there is the additional issue that the special="exclude" code is based on guess work, to find possible data structures. If this area here is changed and a pageTsConfig syntax change is raised, it would probably be a good idea to solve the access restrictions area at the same time - see the related methods that deal with flex field handling for special="exclude" for more comments on this. Another limitation is that the current syntax in both pageTsConfig and exclude fields does not consider flex form section containers at all.

Parameters
string$dataStructureIdentifier

Definition at line 179 of file TcaFlexProcess.php.

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaFlexProcess\addData().

◆ modifyDataStructureAndDataValuesByFlexFormSegmentGroup()

array TYPO3\CMS\Backend\Form\FormDataProvider\TcaFlexProcess::modifyDataStructureAndDataValuesByFlexFormSegmentGroup ( array  $result,
  $fieldName,
  $pageTsConfig 
)
protected

Feed single flex field and data to FlexFormSegment FormData compiler and merge result. This one is nasty. Goal is to have processed TCA stuff in DS and also have validated / processed data values.

Two main parts in this method:

  • ‪Process values and TCA of existing section containers
  • ‪Process TCA of "normal" fields
Parameters
array$result‪Result array
string$fieldName‪Current handle field name
array$pageTsConfig‪Given pageTsConfig of this flex form
Returns
‪array Modified item array
Exceptions

Definition at line 332 of file TcaFlexProcess.php.

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaFlexProcess\addData().

◆ modifyOuterDataStructure()

array TYPO3\CMS\Backend\Form\FormDataProvider\TcaFlexProcess::modifyOuterDataStructure ( array  $result,
  $fieldName,
  $pageTsConfig 
)
protected

Handle "outer" flex data structure changes like language and sheet description. Does not change "TCA" or values of single elements

Parameters
array$result‪Result array
string$fieldName‪Current handle field name
array$pageTsConfig‪Given pageTsConfig of this flex form
Returns
‪array Modified item array

Definition at line 222 of file TcaFlexProcess.php.

References TYPO3\CMS\Backend\Form\FormDataProvider\TcaFlexProcess\modifySingleSheetInformation().

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaFlexProcess\addData().

◆ modifySingleSheetInformation()

array TYPO3\CMS\Backend\Form\FormDataProvider\TcaFlexProcess::modifySingleSheetInformation ( array  $dataStructure,
array  $pageTsOfSheet 
)
protected

Modify data structure of a single "sheet" Sets "secondary" data like sheet names and so on, but does NOT modify single elements

Parameters
array$dataStructure‪Given data structure
array$pageTsOfSheet‪Page Ts config of given field
Returns
‪array Modified data structure

Definition at line 614 of file TcaFlexProcess.php.

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaFlexProcess\modifyOuterDataStructure().

◆ prepareNewSectionContainer()

array TYPO3\CMS\Backend\Form\FormDataProvider\TcaFlexProcess::prepareNewSectionContainer ( array  $result,
string  $fieldName 
)
protected

Prepare data structure and data values for a new section container.

Parameters
array$result‪Incoming result array
string$fieldName‪The field name with this flex form
Returns
‪array Modified result

Definition at line 553 of file TcaFlexProcess.php.

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaFlexProcess\addData().

◆ removeDisabledFieldsFromDataStructure()

array TYPO3\CMS\Backend\Form\FormDataProvider\TcaFlexProcess::removeDisabledFieldsFromDataStructure ( array  $result,
  $fieldName,
  $pageTsConfig 
)
protected

Remove fields from data structure that are disabled in pageTsConfig.

Parameters
array$result‪Result array
string$fieldName‪Current handle field name
array$pageTsConfig‪Given pageTsConfig of this flex form
Returns
‪array Modified item array

Definition at line 298 of file TcaFlexProcess.php.

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaFlexProcess\addData().

◆ removeExcludeFieldsFromDataStructure()

array TYPO3\CMS\Backend\Form\FormDataProvider\TcaFlexProcess::removeExcludeFieldsFromDataStructure ( array  $result,
  $fieldName,
  $flexIdentifier 
)
protected

Removes fields from data structure the user has no access to

Parameters
array$result‪Result array
string$fieldName‪Current handle field name
string$flexIdentifier‪Determined identifier
Returns
‪array Modified result

Definition at line 257 of file TcaFlexProcess.php.

References TYPO3\CMS\Backend\Form\FormDataProvider\TcaFlexProcess\getBackendUser(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaFlexProcess\addData().

◆ scanForInvalidSectionContainerTca()

TYPO3\CMS\Backend\Form\FormDataProvider\TcaFlexProcess::scanForInvalidSectionContainerTca ( array  $result,
string  $fieldName 
)
protected

Some TCA combinations like inline or nesting a section into a section container is not supported and throws exceptions.

Parameters
array$result‪Result array
string$fieldName‪Handled field name
Exceptions

Definition at line 81 of file TcaFlexProcess.php.

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaFlexProcess\addData().