TYPO3 6 and earlier version – Custom TCA for different TYPO3 versions

Related to the this post, where I had solved a problem with TCA and the t3editor, there appears another problem.
The t3editor in my extension works now fine with TYPO3 6 – but TYPO3 4.x we have destroyed the functionality.

But with a small ‘TCA hack’ we are able to fix it. Just append the next PHP code after the TCA, that uses the t3editor, like this:

if(isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['compat_version'])) {
  if((float)$GLOBALS['TYPO3_CONF_VARS']['SYS']['compat_version']<6) {
      $TCA['tx_ftm_domain_model_templatemarker']['columns']['marker_typo_script']['config']['wizards']['t3editorTypoScript']['userFunc'] = 
        'EXT:t3editor/classes/class.tx_t3editor_tceforms_wizard.php:tx_t3editor_tceforms_wizard->main';
  }
}

In the first line we make sure that the variable of the compat version is defined. After that we check if the TYPO3 version is lower that TYPO3 6. If it so, we overwrite the TCA field, where the userFunc is defined and makes the classes-c lowercase.

If you have some optimizations or tipps, feel free to comment this post 🙂

  1. No comments yet.