Here's my patch for the current 4.5.19. I copied the original File
class.t3lib_tceforms.php
to
class.t3lib_tceforms.php,org
first:
--- class.t3lib_tceforms.php,org 2012-10-01 15:13:07.000000000 +0200
+++ class.t3lib_tceforms.php 2012-10-01 15:19:56.000000000 +0200
@ -2800,7 +2800,12 @
$replace .= '.replace(/(tceforms-(datetime|date)field-)/g,"$1" + (new Date()).getTime())';
$onClickInsert = 'var ' . $var . ' = "' . 'idx"+(new Date()).getTime();';
// Do not replace $isTagPrefix in setActionStatus() because it needs section id!
- $onClickInsert .= 'new Insertion.Bottom($("' . $idTagPrefix . '"), ' . json_encode($newElementTemplate) . '.' . $replace . '); setActionStatus("' . $idTagPrefix . '");';
+ if ( (strtolower($GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset']) ===
+'utf-8') )
+ $newElementTemplatePatched = $newElementTemplate;
+ else
+ $newElementTemplatePatched = utf8_encode( $newElementTemplate );
+ $onClickInsert .= 'new Insertion.Bottom($("' . $idTagPrefix . '"), ' . json_encode( $newElementTemplatePatched ) . '.' . $replace . '); setActionStatus("' . $idTagPrefix . '");';
$onClickInsert .= 'eval(unescape("' . rawurlencode(implode(';', $this->additionalJS_post)) . '").' . $replace . ');';
$onClickInsert .= 'TBE_EDITOR.addActionChecks("submit", unescape("' . rawurlencode(implode(';', $this->additionalJS_submit)) . '").' . $replace . ');';
$onClickInsert .= 'TYPO3.TCEFORMS.update();';
Please note: This patch should not be used for TYPO3 Version >= 4.6, since this will probably fail:
if ( (strtolower($GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset']) === 'utf-8') )