[TYPO3-core] RFC: Feature #6635: Allow dynamic values in TCAdefaults

Christian Trabold christian.trabold at dkd.de
Fri Nov 2 14:34:43 CET 2007


This is an SVN patch request.

Type: New feature / Code cleanup

Bugtracker references:
http://bugs.typo3.org/view.php?id=6635

Branches:
trunk

Problem:
At the moment only static values can be set via TCAdefaults.

Dynamic values can only be set via $TCA[...]['config]['default'] but 
sometimes you'd like to set different default values for different page 
branches.

Thus it would be nice to use TCAdefaults to get dynamic values depending 
on the page branches.


Solution:
Alter the method "fetchRecord" in "class.t3lib_transferdata.php" so the 
userFunc-Call can be processed (see attached Patch for details).


Notes:
The patch also cleanes up the code a bit. Both TCAdefault-arrays of 
User- and Page-TSconfig are merged by 
t3lib_div::array_merge_recursive_overrule() before processing the array 
in foreach.

Also some variables are renamed and "$TSconfig" is introduced.

I hope you'll find this feature useful too.


Greetings

Christian


More information about the TYPO3-team-core mailing list