Bug #23672
closedhtmlArea RTE: Insufficient Check for BE / FE Context
0%
Description
There have been issues with the RTE in combination with EXT:solr. Solr reads TypoScript in the backend by instanciating TSFE. The RTE tries to detect whether it's running in FE mode / context. Due to the existing instance of TSFE the RTE then believes it's in FE mode and tries to load and merge language labels. This then leads to a fatal error as t3lib_div::array_merge_recursive_overrule() tries to merge an array with NULL.
The issue is easy to fix by properly detecting the FE context:
TYPO3_MODE == 'FE'
Described here:
http://forge.typo3.org/issues/9375
http://forge.typo3.org/issues/9983
I was able to reproduce this behavior. You would need the early access version though.
Exception call trace:
Uncaught TYPO3 Exception
#1: PHP Catchable Fatal Error: Argument 1 passed to t3lib_div::array_merge_recursive_overrule() must be an array, null given, called in /Users/ingo/Projects/TYPO3/src/typo3_src-trunk_2/typo3/sysext/rtehtmlarea/class.tx_rtehtmlareaapi.php on line 80 and defined in /Users/ingo/Projects/TYPO3/src/typo3_src-trunk_2/t3lib/class.t3lib_div.php line 2073
t3lib_error_Exception thrown in file
/Users/ingo/Projects/TYPO3/src/typo3_src-trunk_2/t3lib/error/class.t3lib_error_errorhandler.php in line 106.
12 t3lib_error_ErrorHandler::handleError(4096, "Argument 1 passed to t3lib_div::array_merge_recurs…class.tx_rtehtmlareaapi.php on line 80 and defined", "/Users/ingo/Projects/TYPO3/src/typo3_src-trunk_2/t3lib/class.t3lib_div.php", 2073, array)
/Users/ingo/Projects/TYPO3/src/typo3_src-trunk_2/t3lib/class.t3lib_div.php:
02071: * @return array Resulting array where $arr1 values has overruled $arr0 values
02072: */
02073: public static function array_merge_recursive_overrule(array $arr0,array $arr1,$notAddKeys=0,$includeEmtpyValues=true) {
02074: foreach ($arr1 as $key => $val) {
02075: if(is_array($arr0[$key])) {
11 t3lib_div::array_merge_recursive_overrule(NULL, array)
/Users/ingo/Projects/TYPO3/src/typo3_src-trunk_2/typo3/sysext/rtehtmlarea/class.tx_rtehtmlareaapi.php:
00078: if ($this->relativePathToLocallangFile) {
00079: if ($this->htmlAreaRTE->is_FE()) {
00080: $this->LOCAL_LANG = t3lib_div::array_merge_recursive_overrule($this->LOCAL_LANG, t3lib_div::readLLfile('EXT:' . $this->extensionKey . '/' . $this->relativePathToLocallangFile, $this->htmlAreaRTE->language));
00081: } else {
00082: $LANG->includeLLFile('EXT:' . $this->extensionKey . '/' . $this->relativePathToLocallangFile);
10 tx_rtehtmlareaapi::main(tx_rtehtmlarea_base)
/Users/ingo/Projects/TYPO3/src/typo3_src-trunk_2/typo3/sysext/rtehtmlarea/class.tx_rtehtmlarea_base.php:
00522: }
00523: if (is_object($plugin)) {
00524: if ($plugin->main($this)) {
00525: $this->registeredPlugins[$pluginId] = $plugin;
00526: // Override buttons from previously registered plugins
9 tx_rtehtmlarea_base::enableRegisteredPlugins()
/Users/ingo/Projects/TYPO3/src/typo3_src-trunk_2/typo3/sysext/rtehtmlarea/class.tx_rtehtmlarea_base.php:
00493:
00494: // Enable registred plugins
00495: $this->enableRegisteredPlugins();
00496:
00497: // Configure toolbar
8 tx_rtehtmlarea_base::initializeToolbarConfiguration()
/Users/ingo/Projects/TYPO3/src/typo3_src-trunk_2/typo3/sysext/rtehtmlarea/class.tx_rtehtmlarea_base.php:
00320: * =======================================
00321: /
00322: $this->initializeToolbarConfiguration();
00323:
00324: / =======================================
7 tx_rtehtmlarea_base::drawRTE(t3lib_TCEforms, "tt_content", "bodytext", array, array, array, array, "text", "", 85)
/Users/ingo/Projects/TYPO3/src/typo3_src-trunk_2/t3lib/class.t3lib_tceforms.php:
01289: // Get RTE object, draw form and set flag:
01290: $RTEobj = t3lib_BEfunc::RTEgetObj();
01291: $item = $RTEobj->drawRTE($this,$table,$field,$row,$PA,$specConf,$thisConfig,$RTEtypeVal,$RTErelPath,$thePidValue);
01292:
01293: // Wizard:
6 t3lib_TCEforms::getSingleField_typeText("tt_content", "bodytext", array, array)
/Users/ingo/Projects/TYPO3/src/typo3_src-trunk_2/t3lib/class.t3lib_tceforms.php:
00997: break;
00998: case 'text':
00999: $item = $this->getSingleField_typeText($table,$field,$row,$PA);
01000: break;
01001: case 'check':
5 t3lib_TCEforms::getSingleField_SW("tt_content", "bodytext", array, array)
/Users/ingo/Projects/TYPO3/src/typo3_src-trunk_2/t3lib/class.t3lib_tceforms.php:
00907:
00908: // Based on the type of the item, call a render function:
00909: $item = $this->getSingleField_SW($table,$field,$row,$PA);
00910:
00911: // Add language + diff
4 t3lib_TCEforms::getSingleField("tt_content", "bodytext", array, "", 0, "richtext:rte_transform[flag=rte_enabled|mode=ts_css]", "9")
/Users/ingo/Projects/TYPO3/src/typo3_src-trunk_2/t3lib/class.t3lib_tceforms.php:
00569: $this->palettesRendered[$this->renderDepth][$table][$parts2] = 1;
00570: }
00571: $sField = $this->getSingleField($table,$theField,$row,$parts1,0,$parts3,$parts2);
00572: if ($sField) { $sField.= $sFieldPal; }
00573:
3 t3lib_TCEforms::getMainFields("tt_content", array)
/Users/ingo/Projects/TYPO3/src/typo3_src-trunk_2/typo3/alt_doc.php:
00772: }
00773: } else {
00774: $panel.= $this->tceforms->getMainFields($table,$rec);
00775: }
00776: $panel = $this->tceforms->wrapTotal($panel,$rec,$table);
2 SC_alt_doc::makeEditForm()
/Users/ingo/Projects/TYPO3/src/typo3_src-trunk_2/typo3/alt_doc.php:
00537:
00538: // Creating the editing form, wrap it with buttons, document selector etc.
00539: $editForm = $this->makeEditForm();
00540:
00541: if ($editForm) {
1 SC_alt_doc::main()
/Users/ingo/Projects/TYPO3/src/typo3_src-trunk_2/typo3/alt_doc.php:
01492: // Main:
01493: $SOBE->init();
01494: $SOBE->main();
01495: $SOBE->printContent();
01496:
(issue imported from #M15893)
Files