* @return void
*/
protected function addEnableFieldsStatement($selectorName, array &$sql) {
- // TODO We have to call the appropriate API method if we are in TYPO3BE mode
if (is_array($GLOBALS['TCA'][$selectorName]['ctrl'])) {
- $statement = substr($GLOBALS['TSFE']->sys_page->enableFields($selectorName), 5);
+ if (TYPO3_MODE === 'FE') {
+ $statement = substr($GLOBALS['TSFE']->sys_page->enableFields($selectorName), 5);
+ } else { // TYPO3_MODE === 'BE'
+ $statement = substr(t3lib_BEfunc::BEenableFields($selectorName), 5);
+ }
if(!empty($statement)) {
$sql['enableFields'][] = $statement;
}