Revert "[!!!][TASK] Get rid of loadTCA and simplify FE cache behavior" 52/18252/3
authorChristian Kuhn <lolli@schwarzbu.ch>
Wed, 13 Feb 2013 16:39:32 +0000 (17:39 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Wed, 13 Feb 2013 16:46:22 +0000 (17:46 +0100)
This reverts commit d7b5d829e7d9a3a6699803e5c7ea308e6b2f55ca

Change-Id: Ifdde18979c8ca0b617132daf84d283e9fc257a3d
Related: #45107
Reviewed-on: https://review.typo3.org/18252
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
65 files changed:
t3lib/class.t3lib_userauthgroup.php
t3lib/stddb/tables.php
typo3/show_item.php
typo3/sysext/backend/Classes/Configuration/TranslationConfigurationProvider.php
typo3/sysext/backend/Classes/Controller/ContentElement/ElementInformationController.php
typo3/sysext/backend/Classes/Controller/ContentElement/NewContentElementController.php
typo3/sysext/backend/Classes/Controller/PageLayoutController.php
typo3/sysext/backend/Classes/Controller/Wizard/EditController.php
typo3/sysext/backend/Classes/Form/DataPreprocessor.php
typo3/sysext/backend/Classes/Form/Element/InlineElement.php
typo3/sysext/backend/Classes/Form/Element/SuggestElement.php
typo3/sysext/backend/Classes/Form/FormEngine.php
typo3/sysext/backend/Classes/History/RecordHistory.php
typo3/sysext/backend/Classes/RecordList/ElementBrowserRecordList.php
typo3/sysext/backend/Classes/Search/LiveSearch/LiveSearch.php
typo3/sysext/backend/Classes/Tree/View/AbstractTreeView.php
typo3/sysext/backend/Classes/Utility/BackendUtility.php
typo3/sysext/backend/Classes/View/PageLayoutView.php
typo3/sysext/backend/Tests/Unit/Utility/BackendUtilityTest.php
typo3/sysext/cms/tslib/index_ts.php
typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php
typo3/sysext/core/Classes/Category/Collection/CategoryCollection.php
typo3/sysext/core/Classes/Collection/AbstractRecordCollection.php
typo3/sysext/core/Classes/Core/Bootstrap.php
typo3/sysext/core/Classes/DataHandling/DataHandler.php
typo3/sysext/core/Classes/Database/QueryGenerator.php
typo3/sysext/core/Classes/Database/QueryView.php
typo3/sysext/core/Classes/Database/ReferenceIndex.php
typo3/sysext/core/Classes/Database/RelationHandler.php
typo3/sysext/core/Classes/FrontendEditing/FrontendEditingController.php
typo3/sysext/core/Classes/Integrity/DatabaseIntegrityCheck.php
typo3/sysext/core/Classes/Resource/Driver/DriverRegistry.php
typo3/sysext/core/Classes/Tree/TableConfiguration/TreeDataProviderFactory.php
typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php
typo3/sysext/core/Classes/Utility/GeneralUtility.php
typo3/sysext/core/Classes/Utility/RootlineUtility.php
typo3/sysext/core/Tests/Unit/Utility/ExtensionMangementUtilityTest.php
typo3/sysext/core/Tests/Unit/Utility/Fixtures/RuntimeException.php [deleted file]
typo3/sysext/core/Tests/Unit/Utility/GeneralUtilityTest.php
typo3/sysext/cshmanual/Classes/Controller/HelpModuleController.php
typo3/sysext/css_styled_content/Classes/Controller/CssStyledContentController.php
typo3/sysext/css_styled_content/ext_tables.php
typo3/sysext/felogin/ext_tables.php
typo3/sysext/form/ext_tables.php
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
typo3/sysext/frontend/Classes/Page/PageRepository.php
typo3/sysext/frontend/Classes/Utility/EidUtility.php
typo3/sysext/frontend/Classes/View/AdminPanelView.php
typo3/sysext/impexp/Classes/ImportExport.php
typo3/sysext/indexed_search/ext_tables.php
typo3/sysext/install/Classes/Installer.php
typo3/sysext/lang/locallang_csh_em.xlf
typo3/sysext/lowlevel/Classes/CleanFlexformCommand.php
typo3/sysext/lowlevel/Classes/View/ConfigurationView.php
typo3/sysext/openid/ext_tables.php
typo3/sysext/recordlist/Classes/RecordList/AbstractDatabaseRecordList.php
typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php
typo3/sysext/rtehtmlarea/hooks/softref/ext_tables.php
typo3/sysext/saltedpasswords/ext_tables.php
typo3/sysext/statictemplates/ext_tables.php
typo3/sysext/statictemplates/media/scripts/fe_adminLib.inc
typo3/sysext/t3editor/ext_tables.php
typo3/sysext/t3skin/ext_tables.php
typo3/sysext/tstemplate_info/Classes/Controller/TypoScriptTemplateInformationModuleFunctionController.php

index be698f3..0eaec1d 100644 (file)
@@ -493,6 +493,7 @@ abstract class t3lib_userAuthGroup extends t3lib_userAuth {
                        }
                        break;
                case 'individual':
+                       t3lib_div::loadTCA($table);
                        if (is_array($GLOBALS['TCA'][$table]) && is_array($GLOBALS['TCA'][$table]['columns'][$field])) {
                                $items = $GLOBALS['TCA'][$table]['columns'][$field]['config']['items'];
                                if (is_array($items)) {
@@ -589,6 +590,7 @@ abstract class t3lib_userAuthGroup extends t3lib_userAuth {
         */
        public function recordEditAccessInternals($table, $idOrRow, $newRecord = FALSE, $deletedRecord = FALSE, $checkFullLanguageAccess = FALSE) {
                if (isset($GLOBALS['TCA'][$table])) {
+                       t3lib_div::loadTCA($table);
                        // Always return TRUE for Admin users.
                        if ($this->isAdmin()) {
                                return TRUE;
index b45f78a..418c989 100644 (file)
@@ -53,8 +53,8 @@
  * Revised for TYPO3 3.6 July/2003 by Kasper Skårhøj
  *
  * @author Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @see tslib_fe::includeTCA(), typo3/init.php, t3lib/stddb/load_ext_tables.php
  */
-
 /**
  * $PAGES_TYPES defines the various types of pages (field: doktype) the system
  * can handle and what restrictions may apply to them.
@@ -184,6 +184,8 @@ $TCA['pages'] = array(
                'searchFields' => 'title,alias,nav_title,subtitle,url,keywords,description,abstract,author,author_email'
        )
 );
+// Initialize the additional configuration of the table 'pages':
+\TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('pages');
 /**
  * Table "be_users":
  * Backend Users for TYPO3.
index 7dd87b1..b2774dc 100644 (file)
@@ -64,6 +64,7 @@ class transferData extends \TYPO3\CMS\Backend\Form\DataPreprocessor {
         * @todo Define visibility
         */
        public function regItem($table, $id, $field, $content) {
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                $config = $GLOBALS['TCA'][$table]['columns'][$field]['config'];
                switch ($config['type']) {
                case 'input':
index 60b0177..7da136e 100644 (file)
@@ -102,6 +102,7 @@ class TranslationConfigurationProvider {
         */
        public function translationInfo($table, $uid, $sys_language_uid = 0, $row = NULL, $selFieldList = '') {
                if ($GLOBALS['TCA'][$table] && $uid) {
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                        if ($row === NULL) {
                                $row = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordWSOL($table, $uid);
                        }
index 4f5e0da..d693889 100644 (file)
@@ -119,6 +119,7 @@ class ElementInformationController {
                // Checking if the $table value is really a table and if the user has
                // access to it.
                if (isset($GLOBALS['TCA'][$this->table])) {
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($this->table);
                        $this->type = 'db';
                        $this->uid = intval($this->uid);
                        // Check permissions and uid value:
@@ -149,6 +150,7 @@ class ElementInformationController {
                                $this->access = $this->fileObject->checkActionPermission('read');
                                $this->type = 'file';
                                $this->table = 'sys_file';
+                               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($this->table);
                                try {
                                        $this->row = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordWSOL($this->table, $this->fileObject->getUid());
                                } catch (\Exception $e) {
@@ -385,6 +387,7 @@ class ElementInformationController {
         * @return string Field name
         */
        public function getFieldName($tableName, $fieldName) {
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($tableName);
                if ($GLOBALS['TCA'][$tableName]['columns'][$fieldName]['label'] !== NULL) {
                        $field = $GLOBALS['LANG']->sL($GLOBALS['TCA'][$tableName]['columns'][$fieldName]['label']);
                        if (trim($field) === '') {
index be6de43..3e20fb2 100644 (file)
@@ -417,6 +417,8 @@ class NewContentElementController {
         * @todo Define visibility
         */
        public function removeInvalidElements(&$wizardItems) {
+               // Load full table definition:
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('tt_content');
                // Get TCEFORM from TSconfig of current page
                $row = array('pid' => $this->id);
                $TCEFORM_TSconfig = \TYPO3\CMS\Backend\Utility\BackendUtility::getTCEFORM_TSconfig('tt_content', $row);
index c4b8d83..c7c2b9c 100644 (file)
@@ -813,6 +813,8 @@ class PageLayoutController {
                // Traverse the list of table names which has records on this page (that array is populated
                // by the $dblist object during the function getTableMenu()):
                foreach ($dblist->activeTables as $table => $value) {
+                       // Load full table definitions:
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                        if (!isset($dblist->externalTables[$table])) {
                                $q_count = $this->getNumberOfHiddenElements();
                                $h_func_b = \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncCheck($this->id, 'SET[tt_content_showHidden]', $this->MOD_SETTINGS['tt_content_showHidden'], 'db_layout.php', '', 'id="checkTt_content_showHidden"') . '<label for="checkTt_content_showHidden">' . (!$q_count ? $GLOBALS['TBE_TEMPLATE']->dfw($GLOBALS['LANG']->getLL('hiddenCE')) : $GLOBALS['LANG']->getLL('hiddenCE') . ' (' . $q_count . ')') . '</label>';
index 7be6863..d2754de 100644 (file)
@@ -47,6 +47,7 @@ class EditController {
                        // Initialize:
                        $table = $this->P['table'];
                        $field = $this->P['field'];
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                        $config = $GLOBALS['TCA'][$table]['columns'][$field]['config'];
                        $fTable = $this->P['currentValue'] < 0 ? $config['neg_foreign_table'] : $config['foreign_table'];
                        // Detecting the various allowed field type setups and acting accordingly.
index bafebfd..106eef8 100644 (file)
@@ -112,6 +112,7 @@ class DataPreprocessor {
                        $idList = $this->prevPageID;
                }
                if ($GLOBALS['TCA'][$table]) {
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                        // For each ID value (integer) we
                        $ids = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $idList, 1);
                        foreach ($ids as $id) {
@@ -215,6 +216,7 @@ class DataPreprocessor {
                }
                // Init:
                $uniqueItemRef = $table . '_' . $id;
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                // Fetches the true PAGE TSconfig pid to use later, if needed. (Until now, only for the RTE, but later..., who knows?)
                list($tscPID) = \TYPO3\CMS\Backend\Utility\BackendUtility::getTSCpid($table, $id, $pid);
                $TSconfig = \TYPO3\CMS\Backend\Utility\BackendUtility::getTCEFORM_TSconfig($table, array_merge($row, array('uid' => $id, 'pid' => $pid)));
@@ -258,6 +260,7 @@ class DataPreprocessor {
                $totalRecordContent = array();
                // Traverse the configured columns for the table (TCA):
                // For each column configured, we will perform processing if needed based on the type (eg. for "group" and "select" types this is needed)
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                $copyOfColumns = $GLOBALS['TCA'][$table]['columns'];
                foreach ($copyOfColumns as $field => $fieldConfig) {
                        // Set $data variable for the field, either inputted value from $row - or if not found, the default value as defined in the "config" array
index 43f6827..6d04846 100644 (file)
@@ -181,6 +181,7 @@ class InlineElement {
                // Init:
                $config = $PA['fieldConf']['config'];
                $foreign_table = $config['foreign_table'];
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($foreign_table);
                if (\TYPO3\CMS\Backend\Utility\BackendUtility::isTableLocalizable($table)) {
                        $language = intval($row[$GLOBALS['TCA'][$table]['ctrl']['languageField']]);
                }
@@ -1802,6 +1803,7 @@ class InlineElement {
                                if ($i > 0 && $i % 3 == 0) {
                                        // Load the TCA configuration of the table field and store it in the stack
                                        if ($loadConfig) {
+                                               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($unstable['table']);
                                                $unstable['config'] = $GLOBALS['TCA'][$unstable['table']]['columns'][$unstable['field']]['config'];
                                                // Fetch TSconfig:
                                                $TSconfig = $this->fObj->setTSconfig($unstable['table'], array('uid' => $unstable['uid'], 'pid' => $this->inlineFirstPid), $unstable['field']);
index 7a7fd5e..3179832 100644 (file)
@@ -113,6 +113,7 @@ class SuggestElement {
                $field = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('field');
                $uid = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('uid');
                $pageId = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('pid');
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                // If the $uid is numeric, we have an already existing element, so get the
                // TSconfig of the page itself or the element container (for non-page elements)
                // otherwise it's a new element, so use given id of parent page (i.e., don't modify it here)
@@ -164,6 +165,7 @@ class SuggestElement {
                // fetch the records for each query table. A query table is a table from which records are allowed to
                // be added to the TCEForm selector, originally fetched from the "allowed" config option in the TCA
                foreach ($queryTables as $queryTable) {
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($queryTable);
                        // if the table does not exist, skip it
                        if (!is_array($GLOBALS['TCA'][$queryTable]) || !count($GLOBALS['TCA'][$queryTable])) {
                                continue;
index 292ceb6..f0307df 100644 (file)
@@ -660,6 +660,7 @@ class FormEngine {
         */
        public function getSoloField($table, $row, $theFieldToReturn) {
                if ($GLOBALS['TCA'][$table]) {
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                        $typeNum = $this->getRTypeNum($table, $row);
                        if ($GLOBALS['TCA'][$table]['types'][$typeNum]) {
                                $itemList = $GLOBALS['TCA'][$table]['types'][$typeNum]['showitem'];
@@ -713,6 +714,8 @@ class FormEngine {
                        }
                }
                if ($GLOBALS['TCA'][$table]) {
+                       // Load the full TCA for the table.
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                        // Get dividers2tabs setting from TCA of the current table:
                        $dividers2tabs = &$GLOBALS['TCA'][$table]['ctrl']['dividers2tabs'];
                        // Load the description content for the table.
@@ -907,6 +910,7 @@ class FormEngine {
         * @todo Define visibility
         */
        public function getListedFields($table, $row, $list) {
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                if ($this->edit_showFieldHelp || $this->doLoadTableDescr($table)) {
                        $GLOBALS['LANG']->loadSingleTableDescription($table);
                }
@@ -1003,6 +1007,8 @@ class FormEngine {
                $PA['palette'] = $palette;
                $PA['extra'] = $extra;
                $PA['pal'] = $pal;
+               // Make sure to load full $GLOBALS['TCA'] array for the table:
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                // Get the TCA configuration for the current field:
                $PA['fieldConf'] = $GLOBALS['TCA'][$table]['columns'][$field];
                $PA['fieldConf']['config']['form_type'] = $PA['fieldConf']['config']['form_type'] ? $PA['fieldConf']['config']['form_type'] : $PA['fieldConf']['config']['type'];
@@ -3154,6 +3160,7 @@ function ' . $evalData . '(value) {
                                }
                                if ($foreignUid) {
                                        $foreignRow = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord($foreignTable, $foreignUid, $foreignTypeField);
+                                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($foreignTable);
                                        $this->registerDefaultLanguageData($foreignTable, $foreignRow);
                                        if ($foreignRow[$foreignTypeField]) {
                                                $foreignTypeFieldConfig = $GLOBALS['TCA'][$table]['columns'][$field];
@@ -3393,6 +3400,7 @@ function ' . $evalData . '(value) {
         * @return array The palette elements
         */
        public function loadPaletteElements($table, $row, $palette, $itemList = '') {
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                $parts = array();
                // Getting excludeElements, if any.
                if (!is_array($this->excludeElements)) {
@@ -4277,6 +4285,7 @@ function ' . $evalData . '(value) {
         */
        public function getSingleHiddenField($table, $field, $row) {
                $item = '';
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                if ($GLOBALS['TCA'][$table]['columns'][$field]) {
                        $uid = $row['uid'];
                        $itemName = $this->prependFormFieldNames . '[' . $table . '][' . $uid . '][' . $field . ']';
@@ -5799,6 +5808,7 @@ function ' . $evalData . '(value) {
         */
        public function getDefaultRecord($table, $pid = 0) {
                if ($GLOBALS['TCA'][$table]) {
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                        $row = array();
                        if ($pid < 0 && $GLOBALS['TCA'][$table]['ctrl']['useColumnsForDefaultValues']) {
                                // Fetches the previous record:
index cccdfcf..6ef469c 100644 (file)
@@ -541,6 +541,7 @@ class RecordHistory {
                        $t3lib_diff_Obj = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Utility\\DiffUtility');
                        $fieldsToDisplay = array_keys($entry['newRecord']);
                        foreach ($fieldsToDisplay as $fN) {
+                               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                                if (is_array($GLOBALS['TCA'][$table]['columns'][$fN]) && $GLOBALS['TCA'][$table]['columns'][$fN]['config']['type'] != 'passthrough') {
                                        // Create diff-result:
                                        $diffres = $t3lib_diff_Obj->makeDiffDisplay(\TYPO3\CMS\Backend\Utility\BackendUtility::getProcessedValue($table, $fN, $entry['oldRecord'][$fN], 0, 1), \TYPO3\CMS\Backend\Utility\BackendUtility::getProcessedValue($table, $fN, $entry['newRecord'][$fN], 0, 1));
@@ -811,6 +812,7 @@ class RecordHistory {
         */
        public function removeFilefields($table, $dataArray) {
                if ($GLOBALS['TCA'][$table]) {
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                        foreach ($GLOBALS['TCA'][$table]['columns'] as $field => $config) {
                                if ($config['config']['type'] == 'group' && $config['config']['internal_type'] == 'file') {
                                        unset($dataArray[$field]);
index d5bac9e..df4bb50 100644 (file)
@@ -162,6 +162,7 @@ class ElementBrowserRecordList extends \TYPO3\CMS\Recordlist\RecordList\Database
                // Check validity of the input data and load TCA
                if (isset($TCA[$tableName])) {
                        $this->relatingTable = $tableName;
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($tableName);
                        if ($fieldName && isset($TCA[$tableName]['columns'][$fieldName])) {
                                $this->relatingField = $fieldName;
                        }
index 87444e9..4bc8089 100644 (file)
@@ -311,6 +311,8 @@ class LiveSearch {
        protected function makeQuerySearchByTable($tableName, array $fieldsToSearchWithin) {
                $queryPart = '';
                $whereParts = array();
+               // Load the full TCA for the table, as we need to access column configuration
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($tableName);
                // If the search string is a simple integer, assemble an equality comparison
                if (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($this->queryString)) {
                        foreach ($fieldsToSearchWithin as $fieldName) {
index 52bfd7a..506133f 100644 (file)
@@ -333,6 +333,9 @@ abstract class AbstractTreeView {
                        $this->MOUNTS = array(0 => 0);
                }
                $this->setTreeName();
+               if ($this->table) {
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($this->table);
+               }
                // Setting this to FALSE disables the use of array-trees by default
                $this->data = FALSE;
                $this->dataLookup = FALSE;
index 1ba67c6..6facb31 100644 (file)
@@ -447,6 +447,8 @@ class BackendUtility {
                $theExcludeArray = array();
                $tc_keys = array_keys($GLOBALS['TCA']);
                foreach ($tc_keys as $table) {
+                       // Load table
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                        // All field names configured and not restricted to admins
                        if (is_array($GLOBALS['TCA'][$table]['columns'])
                                        && empty($GLOBALS['TCA'][$table]['ctrl']['adminOnly'])
@@ -512,6 +514,8 @@ class BackendUtility {
                $allowDenyOptions = array();
                $tc_keys = array_keys($GLOBALS['TCA']);
                foreach ($tc_keys as $table) {
+                       // Load table
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                        // All field names configured:
                        if (is_array($GLOBALS['TCA'][$table]['columns'])) {
                                $f_keys = array_keys($GLOBALS['TCA'][$table]['columns']);
@@ -680,6 +684,7 @@ class BackendUtility {
         * @return array
         */
        static public function getTCAtypes($table, $rec, $useFieldNameAsKey = 0) {
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                if ($GLOBALS['TCA'][$table]) {
                        // Get type value:
                        $fieldValue = self::getTCAtypeValue($table, $rec);
@@ -729,6 +734,7 @@ class BackendUtility {
         */
        static public function getTCAtypeValue($table, $row) {
                $typeNum = 0;
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                if ($GLOBALS['TCA'][$table]) {
                        $field = $GLOBALS['TCA'][$table]['ctrl']['type'];
                        if (strpos($field, ':') !== FALSE) {
@@ -1464,6 +1470,8 @@ class BackendUtility {
         * @return string Thumbnail image tag.
         */
        static public function thumbCode($row, $table, $field, $backPath, $thumbScript = '', $uploaddir = NULL, $abs = 0, $tparams = '', $size = '', $linkInfoPopup = TRUE) {
+               // Load table.
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                $tcaConfig = $GLOBALS['TCA'][$table]['columns'][$field]['config'];
                // Check and parse the size parameter
                $sizeParts = array(64, 64);
@@ -1720,6 +1728,8 @@ class BackendUtility {
         * @return string Label for item entry
         */
        static public function getLabelFromItemlist($table, $col, $key) {
+               // Load full TCA for $table
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                // Check, if there is an "items" array:
                if (is_array($GLOBALS['TCA'][$table]) && is_array($GLOBALS['TCA'][$table]['columns'][$col]) && is_array($GLOBALS['TCA'][$table]['columns'][$col]['config']['items'])) {
                        // Traverse the items-array...
@@ -1773,6 +1783,8 @@ class BackendUtility {
                $labels = array();
                $values = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $key, TRUE);
                if (count($values) > 0) {
+                       // Load full TCA for $table
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                        // Check if there is an "items" array
                        if (is_array($GLOBALS['TCA'][$table]) && is_array($GLOBALS['TCA'][$table]['columns'][$column]) && is_array($GLOBALS['TCA'][$table]['columns'][$column]['config']['items'])) {
                                // Loop on all selected values
@@ -1801,6 +1813,8 @@ class BackendUtility {
         * @return string
         */
        static public function getItemLabel($table, $col, $printAllWrap = '') {
+               // Load full TCA for $table
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                // Check if column exists
                if (is_array($GLOBALS['TCA'][$table]) && is_array($GLOBALS['TCA'][$table]['columns'][$col])) {
                        return $GLOBALS['TCA'][$table]['columns'][$col]['label'];
@@ -1926,6 +1940,8 @@ class BackendUtility {
                        // No need to load TCA as uid is not in TCA-array
                        return $value;
                }
+               // Load full TCA for $table
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                // Check if table and field is configured:
                if (is_array($GLOBALS['TCA'][$table]) && is_array($GLOBALS['TCA'][$table]['columns'][$col])) {
                        // Depending on the fields configuration, make a meaningful output value.
@@ -3009,6 +3025,7 @@ class BackendUtility {
         */
        static public function exec_foreign_table_where_query($fieldValue, $field = '', $TSconfig = array(), $prefix = '') {
                $foreign_table = $fieldValue['config'][$prefix . 'foreign_table'];
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($foreign_table);
                $rootLevel = $GLOBALS['TCA'][$foreign_table]['ctrl']['rootLevel'];
                $fTWHERE = $fieldValue['config'][$prefix . 'foreign_table_where'];
                if (strstr($fTWHERE, '###REC_FIELD_')) {
@@ -4046,6 +4063,7 @@ class BackendUtility {
         */
        static public function getTcaFieldConfiguration($table, $field) {
                $configuration = array();
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                if (isset($GLOBALS['TCA'][$table]['columns'][$field]['config'])) {
                        $configuration = $GLOBALS['TCA'][$table]['columns'][$field]['config'];
                }
index 7baa2ee..8bd9801 100644 (file)
@@ -182,6 +182,8 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
         * @todo Define visibility
         */
        public function getTable($table, $id) {
+               // Load full table definition:
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                if (isset($this->externalTables[$table])) {
                        return $this->getExternalTables($id, $table);
                } else {
@@ -891,6 +893,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
        public function dataFields($fieldArr, $table, $row, $out = array()) {
                // Check table validity:
                if ($GLOBALS['TCA'][$table]) {
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                        $thumbsCol = $GLOBALS['TCA'][$table]['ctrl']['thumbnail'];
                        // Traverse fields:
                        foreach ($fieldArr as $fieldName) {
@@ -937,6 +940,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
         * @todo Define visibility
         */
        public function headerFields($fieldArr, $table, $out = array()) {
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                foreach ($fieldArr as $fieldName) {
                        $ll = $GLOBALS['LANG']->sL($GLOBALS['TCA'][$table]['columns'][$fieldName]['label'], 1);
                        $out[$fieldName] = $ll ? $ll : '&nbsp;';
@@ -1136,6 +1140,8 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
         */
        public function tt_content_drawHeader($row, $space = 0, $disableMoveAndNewButtons = FALSE, $langMode = FALSE, $dragDropEnabled = FALSE) {
                $out = '';
+               // Load full table description:
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('tt_content');
                // If show info is set...;
                if ($this->tt_contentConfig['showInfo'] && $GLOBALS['BE_USER']->recordEditAccessInternals('tt_content', $row)) {
                        // Render control panel for the element:
index 0bc1343..ef6d755 100644 (file)
@@ -164,6 +164,7 @@ class BackendUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @dataProvider getCommonSelectFieldsReturnsCorrectFieldsDataProvider
         */
        public function getCommonSelectFieldsReturnsCorrectFields($table, $prefix = '', array $presetFields, array $tca, $expectedFields = '') {
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                $tcaBackup = $GLOBALS['TCA'][$table];
                unset($GLOBALS['TCA'][$table]);
                $GLOBALS['TCA'][$table] = $tca;
@@ -250,6 +251,7 @@ class BackendUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @dataProvider getLabelFromItemlistReturnsCorrectFieldsDataProvider
         */
        public function getLabelFromItemlistReturnsCorrectFields($table, $col = '', $key = '', array $tca, $expectedLabel = '') {
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                $tcaBackup = $GLOBALS['TCA'][$table];
                unset($GLOBALS['TCA'][$table]);
                $GLOBALS['TCA'][$table] = $tca;
@@ -318,6 +320,7 @@ class BackendUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @dataProvider getLabelFromItemListMergedReturnsCorrectFieldsDataProvider
         */
        public function getLabelFromItemListMergedReturnsCorrectFields($pageId, $table, $column = '', $key = '', array $tca, $expectedLabel = '') {
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                $tcaBackup = $GLOBALS['TCA'][$table];
                unset($GLOBALS['TCA'][$table]);
                $GLOBALS['TCA'][$table] = $tca;
index 09314e1..1652cd7 100644 (file)
@@ -140,11 +140,9 @@ if ($TSFE->isBackendUserLoggedIn()) {
                $BE_USER->frontendEdit->initConfigOptions();
        }
 }
-
-$GLOBALS['TT']->push('Load extension tables');
-\TYPO3\CMS\Core\Core\Bootstrap::getInstance()->loadExtensionTables(TRUE);
-$GLOBALS['TT']->pull();
-
+// Get compressed $TCA-Array();
+// After this, we should now have a valid $TCA, though minimized
+$TSFE->getCompressedTCarray();
 // Starts the template
 $TT->push('Start Template', '');
 $TSFE->initTemplate();
index b8d3ab4..2835d56 100644 (file)
@@ -652,6 +652,7 @@ class BackendUserAuthentication extends \TYPO3\CMS\Core\Authentication\AbstractU
                        }
                        break;
                case 'individual':
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                        if (is_array($GLOBALS['TCA'][$table]) && is_array($GLOBALS['TCA'][$table]['columns'][$field])) {
                                $items = $GLOBALS['TCA'][$table]['columns'][$field]['config']['items'];
                                if (is_array($items)) {
@@ -748,6 +749,7 @@ class BackendUserAuthentication extends \TYPO3\CMS\Core\Authentication\AbstractU
         */
        public function recordEditAccessInternals($table, $idOrRow, $newRecord = FALSE, $deletedRecord = FALSE, $checkFullLanguageAccess = FALSE) {
                if (isset($GLOBALS['TCA'][$table])) {
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                        // Always return TRUE for Admin users.
                        if ($this->isAdmin()) {
                                return TRUE;
index 860fd38..60f44d2 100644 (file)
@@ -85,6 +85,7 @@ class CategoryCollection extends \TYPO3\CMS\Core\Collection\AbstractRecordCollec
         * @return \TYPO3\CMS\Core\Collection\CollectionInterface
         */
        static public function load($id, $fillItems = FALSE, $tableName = '') {
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA(static::$storageTableName);
                $collectionRecord = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('*', static::$storageTableName, 'uid=' . intval($id) . \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause(static::$storageTableName));
                $collectionRecord['table_name'] = $tableName;
                return self::create($collectionRecord, $fillItems);
index 9f321e9..fe0e515 100644 (file)
@@ -319,6 +319,7 @@ abstract class AbstractRecordCollection implements \TYPO3\CMS\Core\Collection\Re
         * @return \TYPO3\CMS\Core\Collection\CollectionInterface
         */
        static public function load($id, $fillItems = FALSE) {
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA(static::$storageTableName);
                $collectionRecord = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('*', static::$storageTableName, 'uid=' . intval($id) . \TYPO3\CMS\Backend\Utility\BackendUtility::deleteClause(static::$storageTableName));
                return self::create($collectionRecord, $fillItems);
        }
index b6f7a6f..59e3174 100644 (file)
@@ -793,7 +793,6 @@ class Bootstrap {
                global $_EXTKEY;
                // Include standard tables.php file
                require PATH_t3lib . 'stddb/tables.php';
-               \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::loadNewTcaColumnsConfigFiles();
                \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::loadExtTables($allowCaching);
                // Load additional ext tables script if the file exists
                $extTablesFile = PATH_typo3conf . TYPO3_extTableDef_script;
index 7254287..84e189b 100644 (file)
@@ -770,6 +770,9 @@ class DataHandler {
                                        if (is_array($incomingFieldArray)) {
                                                // Handle native date/time fields
                                                $dateTimeFormats = $GLOBALS['TYPO3_DB']->getDateTimeFormats($table);
+                                               if (!isset($GLOBALS['TCA'][$table]['columns'])) {
+                                                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
+                                               }
                                                foreach ($GLOBALS['TCA'][$table]['columns'] as $column => $config) {
                                                        if (isset($incomingFieldArray[$column])) {
                                                                if (isset($config['config']['dbType']) && \TYPO3\CMS\Core\Utility\GeneralUtility::inList('date,datetime', $config['config']['dbType'])) {
@@ -1089,6 +1092,7 @@ class DataHandler {
         * @todo Define visibility
         */
        public function placeholderShadowing($table, $id) {
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                if ($liveRec = \TYPO3\CMS\Backend\Utility\BackendUtility::getLiveVersionOfRecord($table, $id, '*')) {
                        if ((int) $liveRec['t3ver_state'] > 0) {
                                $justStoredRecord = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord($table, $id);
@@ -1128,6 +1132,7 @@ class DataHandler {
         */
        public function fillInFieldArray($table, $id, $fieldArray, $incomingFieldArray, $realPid, $status, $tscPID) {
                // Initialize:
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                $originalLanguageRecord = NULL;
                $originalLanguage_diffStorage = NULL;
                $diffStorageFlag = FALSE;
@@ -1337,6 +1342,7 @@ class DataHandler {
         * @todo Define visibility
         */
        public function checkValue($table, $field, $value, $id, $status, $realPid, $tscPID) {
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                // Result array
                $res = array();
                $recFID = $table . ':' . $id . ':' . $field;
@@ -2166,6 +2172,7 @@ class DataHandler {
         */
        public function getUnique($table, $field, $value, $id, $newPid = 0) {
                // Initialize:
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                $whereAdd = '';
                $newValue = '';
                if (intval($newPid)) {
@@ -2769,6 +2776,7 @@ class DataHandler {
                $uid = ($origUid = intval($uid));
                // Only copy if the table is defined in $GLOBALS['TCA'], a uid is given and the record wasn't copied before:
                if ($GLOBALS['TCA'][$table] && $uid && !$this->isRecordCopied($table, $uid)) {
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                        // This checks if the record can be selected which is all that a copy action requires.
                        if ($this->doesRecordExist($table, $uid, 'show')) {
                                $fullLanguageCheckNeeded = $table != 'pages';
@@ -2981,6 +2989,7 @@ class DataHandler {
                }
                // Only copy if the table is defined in TCA, a uid is given and the record wasn't copied before:
                if ($GLOBALS['TCA'][$table] && $uid && !$this->isRecordCopied($table, $uid)) {
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                        if ($this->doesRecordExist($table, $uid, 'show')) {
                                // Set up fields which should not be processed. They are still written - just passed through no-questions-asked!
                                $nonFields = array('uid', 'pid', 't3ver_id', 't3ver_oid', 't3ver_wsid', 't3ver_label', 't3ver_state', 't3ver_count', 't3ver_stage', 't3ver_tstamp', 'perms_userid', 'perms_groupid', 'perms_user', 'perms_group', 'perms_everybody');
@@ -3624,6 +3633,7 @@ class DataHandler {
         * @todo Define visibility
         */
        public function moveRecord_procFields($table, $uid, $destPid) {
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                $conf = $GLOBALS['TCA'][$table]['columns'];
                $row = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordWSOL($table, $uid);
                if (is_array($row)) {
@@ -3735,6 +3745,7 @@ class DataHandler {
                $uid = intval($uid);
                if ($GLOBALS['TCA'][$table] && $uid && $this->isNestedElementCallRegistered($table, $uid, 'localize') === FALSE) {
                        $this->registerNestedElementCall($table, $uid, 'localize');
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                        if ($GLOBALS['TCA'][$table]['ctrl']['languageField'] && $GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField'] && !$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerTable'] || $table === 'pages') {
                                if ($langRec = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord('sys_language', intval($language), 'uid,title')) {
                                        if ($this->doesRecordExist($table, $uid, 'show')) {
@@ -3746,6 +3757,7 @@ class DataHandler {
                                                                        if ($table === 'pages') {
                                                                                $pass = $GLOBALS['TCA'][$table]['ctrl']['transForeignTable'] === 'pages_language_overlay' && !\TYPO3\CMS\Backend\Utility\BackendUtility::getRecordsByField('pages_language_overlay', 'pid', $uid, (' AND ' . $GLOBALS['TCA']['pages_language_overlay']['ctrl']['languageField'] . '=' . intval($langRec['uid'])));
                                                                                $Ttable = 'pages_language_overlay';
+                                                                               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($Ttable);
                                                                        } else {
                                                                                $pass = !\TYPO3\CMS\Backend\Utility\BackendUtility::getRecordLocalization($table, $uid, $langRec['uid'], ('AND pid=' . intval($row['pid'])));
                                                                                $Ttable = $table;
@@ -4074,6 +4086,7 @@ class DataHandler {
                                                }
                                        } else {
                                                // Fetches all fields with flexforms and look for files to delete:
+                                               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                                                foreach ($GLOBALS['TCA'][$table]['columns'] as $fieldName => $cfg) {
                                                        $conf = $cfg['config'];
                                                        switch ($conf['type']) {
@@ -4328,6 +4341,7 @@ class DataHandler {
         * @todo Define visibility
         */
        public function deleteRecord_procFields($table, $uid, $undeleteRecord = FALSE) {
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                $conf = $GLOBALS['TCA'][$table]['columns'];
                $row = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord($table, $uid, '*', '', FALSE);
                foreach ($row as $field => $value) {
@@ -4623,6 +4637,7 @@ class DataHandler {
        public function remapListedDBRecords() {
                if (count($this->registerDBList)) {
                        foreach ($this->registerDBList as $table => $records) {
+                               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                                foreach ($records as $uid => $fields) {
                                        $newData = array();
                                        $theUidToUpdate = $this->copyMappingArray_merged[$table][$uid];
@@ -5377,6 +5392,7 @@ class DataHandler {
        public function getExcludeListArray() {
                $list = array();
                foreach (array_keys($GLOBALS['TCA']) as $table) {
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                        if (isset($GLOBALS['TCA'][$table]['columns'])) {
                                foreach ($GLOBALS['TCA'][$table]['columns'] as $field => $config) {
                                        if ($config['exclude'] && !\TYPO3\CMS\Core\Utility\GeneralUtility::inList($this->BE_USER->groupData['non_exclude_fields'], ($table . ':' . $field))) {
@@ -5916,6 +5932,7 @@ class DataHandler {
         * @todo Define visibility
         */
        public function newFieldArray($table) {
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                $fieldArray = array();
                if (is_array($GLOBALS['TCA'][$table]['columns'])) {
                        foreach ($GLOBALS['TCA'][$table]['columns'] as $field => $content) {
@@ -6289,6 +6306,7 @@ class DataHandler {
         */
        public function fixUniqueInPid($table, $uid) {
                if ($GLOBALS['TCA'][$table]) {
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                        $curData = $this->recordInfo($table, $uid, '*');
                        $newData = array();
                        foreach ($GLOBALS['TCA'][$table]['columns'] as $field => $conf) {
@@ -6323,6 +6341,7 @@ class DataHandler {
         */
        public function fixCopyAfterDuplFields($table, $uid, $prevUid, $update, $newData = array()) {
                if ($GLOBALS['TCA'][$table] && $GLOBALS['TCA'][$table]['ctrl']['copyAfterDuplFields']) {
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                        $prevData = $this->recordInfo($table, $prevUid, '*');
                        $theFields = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $GLOBALS['TCA'][$table]['ctrl']['copyAfterDuplFields'], 1);
                        foreach ($theFields as $field) {
@@ -6346,6 +6365,7 @@ class DataHandler {
         */
        public function extFileFields($table) {
                $listArr = array();
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                if (isset($GLOBALS['TCA'][$table]['columns'])) {
                        foreach ($GLOBALS['TCA'][$table]['columns'] as $field => $configArr) {
                                if ($configArr['config']['type'] == 'group' && ($configArr['config']['internal_type'] == 'file' || $configArr['config']['internal_type'] == 'file_reference')) {
@@ -6365,6 +6385,7 @@ class DataHandler {
         */
        public function getUniqueFields($table) {
                $listArr = array();
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                if ($GLOBALS['TCA'][$table]['columns']) {
                        foreach ($GLOBALS['TCA'][$table]['columns'] as $field => $configArr) {
                                if ($configArr['config']['type'] === 'input') {
@@ -6510,6 +6531,7 @@ class DataHandler {
         * @todo Define visibility
         */
        public function extFileFunctions($table, $field, $filelist, $func) {
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                $uploadFolder = $GLOBALS['TCA'][$table]['columns'][$field]['config']['uploadfolder'];
                if ($uploadFolder && trim($filelist) && $GLOBALS['TCA'][$table]['columns'][$field]['config']['internal_type'] == 'file') {
                        $uploadPath = $this->destPathFromUploadFolder($uploadFolder);
index 7355f2f..6a4e8c1 100644 (file)
@@ -242,6 +242,7 @@ class QueryGenerator {
        public function makeFieldList() {
                $fieldListArr = array();
                if (is_array($GLOBALS['TCA'][$this->table])) {
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($this->table);
                        foreach ($GLOBALS['TCA'][$this->table]['columns'] as $fN => $value) {
                                $fieldListArr[] = $fN;
                        }
@@ -276,6 +277,7 @@ class QueryGenerator {
        public function init($name, $table, $fieldList = '') {
                // Analysing the fields in the table.
                if (is_array($GLOBALS['TCA'][$table])) {
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                        $this->name = $name;
                        $this->table = $table;
                        $this->fieldList = $fieldList ? $fieldList : $this->makeFieldList();
@@ -869,6 +871,7 @@ class QueryGenerator {
                                }
                                $counter = 1;
                                if (is_array($GLOBALS['TCA'][$from_table])) {
+                                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($from_table);
                                        $labelField = $GLOBALS['TCA'][$from_table]['ctrl']['label'];
                                        $altLabelField = $GLOBALS['TCA'][$from_table]['ctrl']['label_alt'];
                                        if ($GLOBALS['TCA'][$from_table]['columns'][$labelField]['config']['items']) {
index d268fed..08b200f 100644 (file)
@@ -497,6 +497,7 @@ class QueryView {
                if ($swords) {
                        foreach ($GLOBALS['TCA'] as $table => $value) {
                                // Get fields list
+                               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                                $conf = $GLOBALS['TCA'][$table];
                                // Avoid querying tables with no columns
                                if (empty($conf['columns'])) {
@@ -600,6 +601,7 @@ class QueryView {
        public function getProcessedValueExtra($table, $fN, $fV, $conf, $splitString) {
                // Analysing the fields in the table.
                if (is_array($GLOBALS['TCA'][$table])) {
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                        $fC = $GLOBALS['TCA'][$table]['columns'][$fN];
                        $fields = $fC['config'];
                        $fields['exclude'] = $fC['exclude'];
@@ -867,6 +869,7 @@ class QueryView {
                                }
                                $counter = 1;
                                if (is_array($GLOBALS['TCA'][$from_table])) {
+                                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($from_table);
                                        $labelField = $GLOBALS['TCA'][$from_table]['ctrl']['label'];
                                        $altLabelField = $GLOBALS['TCA'][$from_table]['ctrl']['label_alt'];
                                        if ($GLOBALS['TCA'][$from_table]['columns'][$labelField]['config']['items']) {
index c5bada1..53f5fa9 100644 (file)
@@ -200,6 +200,7 @@ class ReferenceIndex {
                                        }
                                }
                                // Word indexing:
+                               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                                foreach ($GLOBALS['TCA'][$table]['columns'] as $field => $conf) {
                                        if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList('input,text', $conf['config']['type']) && strcmp($record[$field], '') && !\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($record[$field])) {
                                                $this->words_strings[$field] = $record[$field];
@@ -340,6 +341,8 @@ class ReferenceIndex {
         * @todo Define visibility
         */
        public function getRelations($table, $row, $onlyField = '') {
+               // Load full table description
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                // Initialize:
                $uid = $row['uid'];
                $nonFields = explode(',', 'uid,perms_userid,perms_groupid,perms_user,perms_group,perms_everybody,pid');
index c9f9269..0ded8a3 100644 (file)
@@ -195,6 +195,7 @@ class RelationHandler {
                        $this->MM_oppositeTable = $tmp[0];
                        unset($tmp);
                        // Only add the current table name if there is more than one allowed field
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($this->MM_oppositeTable);
                        // We must be sure this has been done at least once before accessing the "columns" part of TCA for a table.
                        $this->MM_oppositeFieldConf = $GLOBALS['TCA'][$this->MM_oppositeTable]['columns'][$this->MM_oppositeField]['config'];
                        if ($this->MM_oppositeFieldConf['allowed']) {
index 93cae6f..439a467 100644 (file)
@@ -59,6 +59,7 @@ class FrontendEditingController {
                $this->TSFE_EDIT = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('TSFE_EDIT');
                // Include classes for editing IF editing module in Admin Panel is open
                if ($GLOBALS['BE_USER']->isFrontendEditingActive()) {
+                       $GLOBALS['TSFE']->includeTCA(0);
                        if ($this->isEditAction()) {
                                $this->editAction();
                        }
index 49f3999..32fe298 100644 (file)
@@ -303,6 +303,7 @@ class DatabaseIntegrityCheck {
                $this->lostPagesList = '';
                if ($pid_list) {
                        foreach ($GLOBALS['TCA'] as $table => $tableConf) {
+                               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                                $pid_list_tmp = $pid_list;
                                if (!isset($GLOBALS['TCA'][$table]['ctrl']['versioningWS']) || !$GLOBALS['TCA'][$table]['ctrl']['versioningWS']) {
                                        // Remove preceding "-1," for non-versioned tables
@@ -362,6 +363,7 @@ class DatabaseIntegrityCheck {
                $list_n = array();
                if ($pid_list) {
                        foreach ($GLOBALS['TCA'] as $table => $tableConf) {
+                               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                                $pid_list_tmp = $pid_list;
                                if (!isset($GLOBALS['TCA'][$table]['ctrl']['versioningWS']) || !$GLOBALS['TCA'][$table]['ctrl']['versioningWS']) {
                                        // Remove preceding "-1," for non-versioned tables
@@ -390,6 +392,7 @@ class DatabaseIntegrityCheck {
        public function getGroupFields($mode) {
                $result = array();
                foreach ($GLOBALS['TCA'] as $table => $tableConf) {
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                        $cols = $GLOBALS['TCA'][$table]['columns'];
                        foreach ($cols as $field => $config) {
                                if ($config['config']['type'] == 'group') {
@@ -418,6 +421,7 @@ class DatabaseIntegrityCheck {
        public function getFileFields($uploadfolder) {
                $result = array();
                foreach ($GLOBALS['TCA'] as $table => $tableConf) {
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                        $cols = $GLOBALS['TCA'][$table]['columns'];
                        foreach ($cols as $field => $config) {
                                if ($config['config']['type'] == 'group' && $config['config']['internal_type'] == 'file' && $config['config']['uploadfolder'] == $uploadfolder) {
@@ -438,6 +442,7 @@ class DatabaseIntegrityCheck {
        public function getDBFields($theSearchTable) {
                $result = array();
                foreach ($GLOBALS['TCA'] as $table => $tableConf) {
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                        $cols = $GLOBALS['TCA'][$table]['columns'];
                        foreach ($cols as $field => $config) {
                                if ($config['config']['type'] == 'group' && $config['config']['internal_type'] == 'db') {
@@ -464,6 +469,7 @@ class DatabaseIntegrityCheck {
                if (is_array($fkey_arrays)) {
                        foreach ($fkey_arrays as $table => $field_list) {
                                if ($GLOBALS['TCA'][$table] && trim($field_list)) {
+                                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                                        $fieldArr = explode(',', $field_list);
                                        if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('dbal')) {
                                                $fields = $GLOBALS['TYPO3_DB']->admin_get_fields($table);
@@ -658,6 +664,7 @@ class DatabaseIntegrityCheck {
                foreach ($fileFields as $info) {
                        $table = $info[0];
                        $field = $info[1];
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                        $mres = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,pid,' . $GLOBALS['TCA'][$table]['ctrl']['label'] . ',' . $field, $table, $field . ' LIKE \'%' . $GLOBALS['TYPO3_DB']->quoteStr($id, $table) . '%\'');
                        while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($mres)) {
                                // Now this is the field, where the reference COULD come from. But we're not garanteed, so we must carefully examine the data.
index 6428579..25de4a4 100644 (file)
@@ -99,6 +99,7 @@ class DriverRegistry implements \TYPO3\CMS\Core\SingletonInterface {
                }
                foreach ($this->driverConfigurations as $driver) {
                        $label = $driver['label'] ?: $driver['class'];
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('sys_file_storage');
                        $driverFieldConfig = &$GLOBALS['TCA']['sys_file_storage']['columns']['driver']['config'];
                        $driverFieldConfig['items'][] = array($label, $driver['shortName']);
                        if ($driver['flexFormDS']) {
index d34aa1e..f641500 100644 (file)
@@ -67,6 +67,7 @@ class TreeDataProviderFactory {
                                if ($tableName == $table) {
                                        $unselectableUids[] = $currentValue['uid'];
                                }
+                               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($tableName);
                        } else {
                                throw new \InvalidArgumentException('TCA Tree configuration is invalid: "foreign_table" not set', 1288215888);
                        }
index 2ca6f88..b9945b3 100644 (file)
@@ -221,6 +221,7 @@ class ExtensionManagementUtility {
         * @return void
         */
        static public function addTCAcolumns($table, $columnArray, $addTofeInterface = 0) {
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                if (is_array($columnArray) && is_array($GLOBALS['TCA'][$table]) && is_array($GLOBALS['TCA'][$table]['columns'])) {
                        // Candidate for \TYPO3\CMS\Core\Utility\GeneralUtility::array_merge() if integer-keys will some day make trouble...
                        $GLOBALS['TCA'][$table]['columns'] = array_merge($GLOBALS['TCA'][$table]['columns'], $columnArray);
@@ -245,6 +246,7 @@ class ExtensionManagementUtility {
         * @return void
         */
        static public function addToAllTCAtypes($table, $str, $specificTypesList = '', $position = '') {
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                $str = trim($str);
                $palettesChanged = array();
                if ($str && is_array($GLOBALS['TCA'][$table]) && is_array($GLOBALS['TCA'][$table]['types'])) {
@@ -309,6 +311,7 @@ class ExtensionManagementUtility {
        static public function addFieldsToAllPalettesOfField($table, $field, $addFields, $insertionPosition = '') {
                $generatedPalette = '';
                $processedPalettes = array();
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                if (isset($GLOBALS['TCA'][$table]['columns'][$field])) {
                        $types = &$GLOBALS['TCA'][$table]['types'];
                        if (is_array($types)) {
@@ -350,6 +353,7 @@ class ExtensionManagementUtility {
         * @return void
         */
        static public function addFieldsToPalette($table, $palette, $addFields, $insertionPosition = '') {
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                if (isset($GLOBALS['TCA'][$table])) {
                        $paletteData = &$GLOBALS['TCA'][$table]['palettes'][$palette];
                        // If palette already exists, merge the data:
@@ -405,6 +409,7 @@ class ExtensionManagementUtility {
                if ($relativePosition !== '' && $relativePosition !== 'before' && $relativePosition !== 'after' && $relativePosition !== 'replace') {
                        throw new \InvalidArgumentException('Relative position must be either empty or one of "before", "after", "replace".', 1303236967);
                }
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                if (!is_array($GLOBALS['TCA'][$table]['columns'][$field]['config']['items'])) {
                        throw new \RuntimeException('Given select field item list was not found.', 1303237468);
                }
@@ -1174,6 +1179,7 @@ class ExtensionManagementUtility {
                if ($_EXTKEY && !$itemArray[2]) {
                        $itemArray[2] = self::extRelPath($_EXTKEY) . $GLOBALS['TYPO3_LOADED_EXT'][$_EXTKEY]['ext_icon'];
                }
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('tt_content');
                if (is_array($GLOBALS['TCA']['tt_content']['columns']) && is_array($GLOBALS['TCA']['tt_content']['columns'][$type]['config']['items'])) {
                        foreach ($GLOBALS['TCA']['tt_content']['columns'][$type]['config']['items'] as $k => $v) {
                                if (!strcmp($v[1], $itemArray[1])) {
@@ -1196,6 +1202,7 @@ class ExtensionManagementUtility {
         * @see addPlugin()
         */
        static public function addPiFlexFormValue($piKeyToMatch, $value, $CTypeToMatch = 'list') {
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('tt_content');
                if (is_array($GLOBALS['TCA']['tt_content']['columns']) && is_array($GLOBALS['TCA']['tt_content']['columns']['pi_flexform']['config']['ds'])) {
                        $GLOBALS['TCA']['tt_content']['columns']['pi_flexform']['config']['ds'][$piKeyToMatch . ',' . $CTypeToMatch] = $value;
                }
@@ -1212,6 +1219,7 @@ class ExtensionManagementUtility {
         * @return void
         */
        static public function addToInsertRecords($table, $content_table = 'tt_content', $content_field = 'records') {
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($content_table);
                if (is_array($GLOBALS['TCA'][$content_table]['columns']) && isset($GLOBALS['TCA'][$content_table]['columns'][$content_field]['config']['allowed'])) {
                        $GLOBALS['TCA'][$content_table]['columns'][$content_field]['config']['allowed'] .= ',' . $table;
                }
@@ -1298,6 +1306,7 @@ tt_content.' . $key . $prefix . ' {
         * @see addTypoScript()
         */
        static public function addStaticFile($extKey, $path, $title) {
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('sys_template');
                if ($extKey && $path && is_array($GLOBALS['TCA']['sys_template']['columns'])) {
                        $value = str_replace(',', '', 'EXT:' . $extKey . '/' . $path);
                        $itemArray = array(trim($title . ' (' . $extKey . ')'), $value);
@@ -1648,7 +1657,6 @@ tt_content.' . $key . $prefix . ' {
                                // and are explicitly set in cached file as well
                                $_EXTCONF = $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$_EXTKEY];
                                require $extensionInformation['ext_tables.php'];
-                               static::loadNewTcaColumnsConfigFiles();
                        }
                }
        }
@@ -1686,7 +1694,6 @@ tt_content.' . $key . $prefix . ' {
                        // Add ext_tables.php content of extension
                        $phpCodeToCache[] = trim(\TYPO3\CMS\Core\Utility\GeneralUtility::getUrl($extensionDetails['ext_tables.php']));
                        $phpCodeToCache[] = '';
-                       $phpCodeToCache[] = '\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::loadNewTcaColumnsConfigFiles();';
                        $phpCodeToCache[] = '';
                }
                $phpCodeToCache = implode(LF, $phpCodeToCache);
@@ -1696,45 +1703,6 @@ tt_content.' . $key . $prefix . ' {
        }
 
        /**
-        * Loads "columns" of a $TCA table definition if extracted
-        * to a "dynamicConfigFile". This method is called after each
-        * single ext_tables.php files was included to immediately have
-        * the full $TCA ready for the next extension.
-        *
-        * $TCA[$tableName]['ctrl']['dynamicConfigFile'] must be the
-        * absolute path to a file.
-        *
-        * Example:
-        * dynamicConfigFile = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($_EXTKEY) . 'Configuration/TCA/SysNote.php',
-        *
-        * @return void
-        * @throws \RuntimeException
-        * @internal Internal use ONLY. It is called by cache files and can not be protected. Do not call yourself!
-        */
-       static public function loadNewTcaColumnsConfigFiles() {
-               global $TCA;
-
-               foreach ($TCA as $tableName => $configuration) {
-                       if (!isset($TCA[$tableName]['columns'])) {
-                               $columnsConfigFile = $TCA[$tableName]['ctrl']['dynamicConfigFile'];
-                               if ($columnsConfigFile) {
-                                       if (GeneralUtility::isAbsPath($columnsConfigFile)) {
-                                               include($columnsConfigFile);
-                                       } elseif (strpos($columnsConfigFile, 'T3LIB:') === 0) {
-                                               // Resolve T3LIB prefix, internal core use only.
-                                               include(PATH_t3lib . 'stddb/' . substr($columnsConfigFile, 6));
-                                       } else {
-                                               throw new \RuntimeException(
-                                                       'Columns configuration file not found',
-                                                       1341151261
-                                               );
-                                       }
-                               }
-                       }
-               }
-       }
-
-       /**
         * Cache identifier for concatenated ext_tables.php files
         *
         * @return string
@@ -2021,6 +1989,8 @@ tt_content.' . $key . $prefix . ' {
         * @see addToAllTCAtypes
         */
        static public function makeCategorizable($extensionKey, $tableName, $fieldName = 'categories', array $options = array()) {
+               // Load TCA first
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($tableName);
                // Update the category registry
                $result = \TYPO3\CMS\Core\Category\CategoryRegistry::getInstance()->add($extensionKey, $tableName, $fieldName);
                if ($result === FALSE) {
index e8f5021..45a6c5e 100644 (file)
@@ -3861,13 +3861,31 @@ Connection: close
         * 2) columns must not be an array (which it is always if whole table loaded), and
         * 3) there is a value for dynamicConfigFile (filename in typo3conf)
         *
+        * Note: For the frontend this loads only 'ctrl' and 'feInterface' parts.
+        * For complete TCA use $GLOBALS['TSFE']->includeTCA() instead.
+        *
         * @param string $table Table name for which to load the full TCA array part into $GLOBALS['TCA']
         * @return void
-        * @deprecated since 6.1, will be removed two versions later
         */
        static public function loadTCA($table) {
-               // This method is obsolete, full TCA is always loaded in all context except eID
-               static::logDeprecatedFunction();
+               // Needed for inclusion of the dynamic config files.
+               global $TCA;
+               if (isset($TCA[$table])) {
+                       $tca = &$TCA[$table];
+                       if (is_array($tca['ctrl']) && !$tca['columns']) {
+                               $dcf = $tca['ctrl']['dynamicConfigFile'];
+                               if ($dcf) {
+                                       if (!strcmp(substr($dcf, 0, 6), 'T3LIB:')) {
+                                               include PATH_t3lib . 'stddb/' . substr($dcf, 6);
+                                       } elseif (self::isAbsPath($dcf) && @is_file($dcf)) {
+                                               // Absolute path...
+                                               include $dcf;
+                                       } else {
+                                               include PATH_typo3conf . $dcf;
+                                       }
+                               }
+                       }
+               }
        }
 
        /**
index 90a31f2..7dd7cf6 100644 (file)
@@ -206,6 +206,12 @@ class RootlineUtility {
         */
        protected function getRecordArray($uid) {
                if (!isset(self::$pageRecordCache[$this->getCacheIdentifier($uid)])) {
+                       if (!is_array($GLOBALS['TCA']['pages']['columns'])) {
+                               if (isset($GLOBALS['TSFE'])) {
+                                       $GLOBALS['TSFE']->includeTCA($GLOBALS['TSFE']->TCAloaded);
+                               }
+                               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('pages');
+                       }
                        $row = $this->databaseConnection->exec_SELECTgetSingleRow(implode(',', self::$rootlineFields), 'pages', 'uid = ' . intval($uid) . ' AND pages.deleted = 0 AND pages.doktype <> ' . \TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_RECYCLER);
                        if (empty($row)) {
                                throw new \RuntimeException('Could not fetch page data for uid ' . $uid . '.', 1343589451);
index f1c6e83..8a332b1 100644 (file)
@@ -85,7 +85,6 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * Create a subclass with protected methods made public
         *
         * @return void
-        * @TODO: Move this to a fixture file
         */
        protected function createAccessibleProxyClass() {
                $namespace = 'TYPO3\\CMS\\Core\\Utility';
@@ -114,7 +113,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
 
        /**
         * @test
-        * @expectedException \BadFunctionCallException
+        * @expectedException BadFunctionCallException
         */
        public function isLoadedThrowsExceptionIfExtensionIsNotLoaded() {
                $this->assertFalse(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded(uniqid('foobar'), TRUE));
@@ -125,7 +124,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
        ///////////////////////////////
        /**
         * @test
-        * @expectedException \BadFunctionCallException
+        * @expectedException BadFunctionCallException
         */
        public function extPathThrowsExceptionIfExtensionIsNotLoaded() {
                $GLOBALS['TYPO3_LOADED_EXT']['foo'] = array();
@@ -142,7 +141,7 @@ class ExtensionManagementUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
 
        /**
         * @test
-        * @expectedException \BadFunctionCallException
+        * @expectedException BadFunctionCallException
         */
        public function extPathThrowsExceptionIfExtensionIsNotLoadedAndTypo3LoadedExtensionsIsEmpty() {
                unset($GLOBALS['TYPO3_LOADED_EXT']);
@@ -863,42 +862,6 @@ throw new \RuntimeException(\'\', 1340559079);
        }
 
        /////////////////////////////////////////
-       // Tests concerning loadNewTcaColumnsConfigFiles
-       /////////////////////////////////////////
-
-       /**
-        * @test
-        * @expectedException \RuntimeException
-        */
-       public function loadNewTcaColumnsConfigFilesIncludesDefinedDynamicConfigFileIfNoColumnsExist() {
-               $GLOBALS['TCA'] = array(
-                       'test' => array(
-                               'ctrl' => array(
-                                       'dynamicConfigFile' => __DIR__ . '/Fixtures/RuntimeException.php'
-                               ),
-                       ),
-               );
-               \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::loadNewTcaColumnsConfigFiles();
-       }
-
-       /**
-        * @test
-        */
-       public function loadNewTcaColumnsConfigFilesDoesNotIncludeFileIfColumnsExist() {
-               $GLOBALS['TCA'] = array(
-                       'test' => array(
-                               'ctrl' => array(
-                                       'dynamicConfigFile' => __DIR__ . '/Fixtures/RuntimeException.php'
-                               ),
-                               'columns' => array(
-                                       'foo' => 'bar',
-                               ),
-                       ),
-               );
-               \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::loadNewTcaColumnsConfigFiles();
-       }
-
-       /////////////////////////////////////////
        // Tests concerning getExtensionVersion
        /////////////////////////////////////////
        /**
diff --git a/typo3/sysext/core/Tests/Unit/Utility/Fixtures/RuntimeException.php b/typo3/sysext/core/Tests/Unit/Utility/Fixtures/RuntimeException.php
deleted file mode 100644 (file)
index 615b450..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-<?php
-       throw new \RuntimeException('Unit test', 1359900487);
-?>
\ No newline at end of file
index 777776a..5c6e9ec 100644 (file)
@@ -1933,6 +1933,32 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $this->assertNull($returnValue);
        }
 
+       ////////////////////////////////////////
+       // Tests concerning loadTCA
+       ////////////////////////////////////////
+
+       /**
+        * @test
+        * @expectedException \RuntimeException
+        */
+       public function loadTCAIncludesConfiguredDynamicConfigFile() {
+               $dynamicConfigurationAbsoluteFilePath = PATH_site . 'typo3temp/' . uniqid('testLoadTca_');
+               file_put_contents(
+                       $dynamicConfigurationAbsoluteFilePath,
+                       '<?php throw new \RuntimeException(\'foo\', 1310203814); ?>'
+               );
+               $this->testFilesToDelete[] = $dynamicConfigurationAbsoluteFilePath;
+
+               $testTableName = uniqid('testTable_');
+               $GLOBALS['TCA'][$testTableName] = array(
+                       'ctrl' => array(
+                               'dynamicConfigFile' => $dynamicConfigurationAbsoluteFilePath,
+                       ),
+               );
+
+               Utility\GeneralUtility::loadTCA($testTableName);
+       }
+
        //////////////////////////////////////
        // Tests concerning addSlashesOnArray
        //////////////////////////////////////
index 3845d79..a99f44d 100644 (file)
@@ -132,6 +132,8 @@ class HelpModuleController {
                        // There's at least one extra part
                        $extraIdentifierInformation = array();
                        $extraIdentifierInformation[] = array_shift($identifierParts);
+                       // Load the TCA details of the table
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($this->table);
                        // If the ds_pointerField contains a comma, it means the choice of FlexForm DS
                        // is determined by 2 parameters. In this case we have an extra identifier part
                        if (strpos($GLOBALS['TCA'][$this->table]['columns'][$this->field]['config']['ds_pointerField'], ',') !== FALSE) {
@@ -371,6 +373,8 @@ class HelpModuleController {
                if ($table === NULL) {
                        $table = $key;
                }
+               // Load table TCA
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($key);
                // Load descriptions for table $table
                $GLOBALS['LANG']->loadSingleTableDescription($key);
                if (is_array($GLOBALS['TCA_DESCR'][$key]['columns']) && (!$this->limitAccess || $GLOBALS['BE_USER']->check('tables_select', $table))) {
@@ -464,6 +468,7 @@ class HelpModuleController {
                                        }
                                } else {
                                        // "table" reference
+                                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($iP[0]);
                                        if (!isset($GLOBALS['TCA'][$iP[0]]) || (!$iP[1] || is_array($GLOBALS['TCA'][$iP[0]]['columns'][$iP[1]])) && (!$this->limitAccess || $GLOBALS['BE_USER']->check('tables_select', $iP[0]) && (!$iP[1] || !$GLOBALS['TCA'][$iP[0]]['columns'][$iP[1]]['exclude'] || $GLOBALS['BE_USER']->check('non_exclude_fields', $iP[0] . ':' . $iP[1])))) {
                                                // Checking read access:
                                                if (isset($GLOBALS['TCA_DESCR'][$iP[0]])) {
@@ -562,6 +567,8 @@ class HelpModuleController {
         */
        public function printItem($key, $field, $anchors = FALSE) {
                $out = '';
+               // Load full table definition in $GLOBALS['TCA']
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($key);
                if ($key && (!$field || is_array($GLOBALS['TCA_DESCR'][$key]['columns'][$field]))) {
                        // Make seeAlso references.
                        $seeAlsoRes = $this->make_seeAlso($GLOBALS['TCA_DESCR'][$key]['columns'][$field]['seeAlso'], $anchors ? $key : '');
index 73388fe..063a355 100644 (file)
@@ -258,6 +258,7 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
                                // Get the list of files from the field
                                $field = trim($conf['field']) ? trim($conf['field']) : 'media';
                                $fileList = $this->cObj->data[$field];
+                               $GLOBALS['TSFE']->includeTCA();
                                $path = 'uploads/media/';
                                if (is_array($GLOBALS['TCA']['tt_content']['columns'][$field]) && !empty($GLOBALS['TCA']['tt_content']['columns'][$field]['config']['uploadfolder'])) {
                                        // In TCA-Array folders are saved without trailing slash, so $path.$fileName won't work
index dbef007..28acfbc 100755 (executable)
@@ -6,6 +6,9 @@ if (!defined('TYPO3_MODE')) {
 // Add flexform
 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('*', 'FILE:EXT:css_styled_content/flexform_ds.xml', 'table');
 
+// Load TCA before manipulating the column configuration
+\TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('tt_content');
+
 $GLOBALS['TCA']['tt_content']['types']['table']['showitem'] = 'CType;;4;;1-1-1, hidden, header;;3;;2-2-2, linkToTop;;;;4-4-4,
                        --div--;LLL:EXT:cms/locallang_ttc.xml:CType.I.5, layout;;10;;3-3-3, cols, bodytext;;9;nowrap:wizards[table], text_properties, pi_flexform,
                        --div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.access, starttime, endtime, fe_group';
index fc20269..8f8ada6 100644 (file)
@@ -3,6 +3,7 @@ if (!defined('TYPO3_MODE')) {
        die('Access denied.');
 }
 $_EXTCONF = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['felogin']);
+\TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('tt_content');
 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue('*', 'FILE:EXT:' . $_EXTKEY . '/flexform.xml', 'login');
 
 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem('tt_content', 'CType', array(
@@ -41,6 +42,7 @@ $tempColumns = array(
                )
        )
 );
+\TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('fe_groups');
 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('fe_groups', $tempColumns, 1);
 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('fe_groups', 'felogin_redirectPid;;;;1-1-1', '', 'after:TSconfig');
 // Adds the redirect field and the forgotHash field to the fe_users-table
@@ -70,6 +72,7 @@ $tempColumns = array(
                )
        )
 );
+\TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('fe_users');
 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('fe_users', $tempColumns, 1);
 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('fe_users', 'felogin_redirectPid;;;;1-1-1', '', 'after:TSconfig');
 ?>
\ No newline at end of file
index f18dee1..6e636fa 100644 (file)
@@ -6,6 +6,9 @@ if (!defined('TYPO3_MODE')) {
 // Add Default TS to Include static (from extensions)
 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile($_EXTKEY, 'Configuration/TypoScript/', 'Default TS');
 
+// Load TCA before manipulating the column configuration
+\TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('tt_content');
+
 $TCA['tt_content']['columns']['bodytext']['config']['wizards']['forms'] = array(
        'notNewRecords' => 1,
        'enableByTypeConfig' => 1,
index f9ac75a..4af309d 100644 (file)
@@ -5542,6 +5542,8 @@ class ContentObjectRenderer {
                $table = $conf['table'];
                $field = $conf['field'];
                $delimiter = $conf['delimiter'] ? $conf['delimiter'] : ' ,';
+               $GLOBALS['TSFE']->includeTCA();
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                if (is_array($GLOBALS['TCA'][$table]) && is_array($GLOBALS['TCA'][$table]['columns'][$field]) && is_array($GLOBALS['TCA'][$table]['columns'][$field]['config']['items'])) {
                        $values = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $inputValue);
                        $output = array();
@@ -7782,4 +7784,4 @@ class ContentObjectRenderer {
 
 }
 
-?>
\ No newline at end of file
+?>
index 77ace77..88ab6b9 100644 (file)
@@ -239,6 +239,12 @@ class TypoScriptFrontendController {
         */
        public $config = '';
 
+       // Array of cached information from TCA. This is NOT TCA itself!
+       /**
+        * @todo Define visibility
+        */
+       public $TCAcachedExtras = array();
+
        // TEMPLATE / CACHE
        /**
         * The TypoScript template object. Used to parse the TypoScript template
@@ -650,6 +656,12 @@ class TypoScriptFrontendController {
         */
        public $scriptParseTime = 0;
 
+       // Set ONLY if the full TCA is loaded
+       /**
+        * @todo Define visibility
+        */
+       public $TCAloaded = 0;
+
        // Character set (charset) conversion object:
        /**
         * charset conversion class. May be used by any application.
@@ -2436,36 +2448,65 @@ class TypoScriptFrontendController {
         * (jumpurl/submission of forms)
         *
         *******************************************/
-
        /**
         * Get the compressed $GLOBALS['TCA'] array for use in the front-end
-        * A compressed $GLOBALS['TCA'] array holds only the ctrl- and feInterface-part for each table.
-        * But the column-definitions are omitted in order to save some memory and be more efficient.
+        * A compressed $GLOBALS['TCA'] array holds only the ctrl- and feInterface-part for each table. But the column-definitions are omitted in order to save some memory and be more efficient.
         * Operates on the global variable, $TCA
         *
         * @return void
-        * @deprecated since 6,1, will be removed in two versions.
+        * @see includeTCA()
+        * @todo Define visibility
         */
        public function getCompressedTCarray() {
-               // Full TCA is always loaded during bootstrap in FE, this method is obsolete.
-               \TYPO3\CMS\Core\Utility\GeneralUtility::logDeprecatedFunction();
+               $GLOBALS['TT']->push('Get Compressed TC array');
+               if (!$this->TCAloaded) {
+                       // Create hash string for storage / retrieval of cached content:
+                       $tempHash = md5('tables.php:' . filemtime((TYPO3_extTableDef_script ? PATH_typo3conf . TYPO3_extTableDef_script : PATH_t3lib . 'stddb/tables.php')) . (TYPO3_extTableDef_script ? filemtime(PATH_typo3conf . TYPO3_extTableDef_script) : ''));
+                       list($GLOBALS['TCA'], $this->TCAcachedExtras) = unserialize($this->sys_page->getHash($tempHash));
+                       // If no result, create it:
+                       if (!is_array($GLOBALS['TCA'])) {
+                               $this->includeTCA(0);
+                               $newTc = array();
+                               // Collects other information
+                               $this->TCAcachedExtras = array();
+                               foreach ($GLOBALS['TCA'] as $key => $val) {
+                                       $newTc[$key]['ctrl'] = $val['ctrl'];
+                                       $newTc[$key]['feInterface'] = $val['feInterface'];
+                                       // Collect information about localization exclusion of fields:
+                                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($key);
+                                       if (is_array($GLOBALS['TCA'][$key]['columns'])) {
+                                               $this->TCAcachedExtras[$key]['l10n_mode'] = array();
+                                               foreach ($GLOBALS['TCA'][$key]['columns'] as $fN => $fV) {
+                                                       if ($fV['l10n_mode']) {
+                                                               $this->TCAcachedExtras[$key]['l10n_mode'][$fN] = $fV['l10n_mode'];
+                                                       }
+                                               }
+                                       }
+                               }
+                               $GLOBALS['TCA'] = $newTc;
+                               $this->sys_page->storeHash($tempHash, serialize(array($newTc, $this->TCAcachedExtras)), 'SHORT_TC');
+                       }
+               }
+               $GLOBALS['TT']->pull();
        }
 
        /**
         * Includes TCA definitions from loaded extensions (ext_table.php files).
         * Normally in the frontend only a part of the global $TCA array is loaded,
         * namely the "ctrl" part. Thus it doesn't take up too much memory. To load
-        * full TCA for the table, use \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($tableName)
-        * after calling this function.
+        * full TCA for the table, use \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($tableName) after calling
+        * this function.
         *
-        * @param integer $TCAloaded Probably, keep hands of this value. Just don't set it.
+        * @param integer $TCAloaded Probably, keep hands of this value. Just don't set it. (This may affect the first-ever time this function is called since if you set it to zero/FALSE any subsequent call will still trigger the inclusion; In other words, this value will be set in $this->TCAloaded after inclusion and therefore if its FALSE, another inclusion will be possible on the next call. See ->getCompressedTCarray())
         * @return void
         * @see getCompressedTCarray()
-        * @deprecated since 6.1, will be removed in two versions
         */
        public function includeTCA($TCAloaded = 1) {
-               // Full TCA is always loaded during bootstrap in FE, this method is obsolete.
-               \TYPO3\CMS\Core\Utility\GeneralUtility::logDeprecatedFunction();
+               if (!$this->TCAloaded) {
+                       $GLOBALS['TCA'] = array();
+                       \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->loadExtensionTables(TRUE);
+                       $this->TCAloaded = $TCAloaded;
+               }
        }
 
        /**
@@ -2553,13 +2594,13 @@ class TypoScriptFrontendController {
                $table_fields = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->config['config']['sys_language_softMergeIfNotBlank'], 1);
                foreach ($table_fields as $TF) {
                        list($tN, $fN) = explode(':', $TF);
-                       $GLOBALS['TCA'][$tN]['columns'][$fN]['l10n_mode'] = 'mergeIfNotBlank';
+                       $this->TCAcachedExtras[$tN]['l10n_mode'][$fN] = 'mergeIfNotBlank';
                }
                // Setting softExclude:
                $table_fields = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->config['config']['sys_language_softExclude'], 1);
                foreach ($table_fields as $TF) {
                        list($tN, $fN) = explode(':', $TF);
-                       $GLOBALS['TCA'][$tN]['columns'][$fN]['l10n_mode'] = 'exclude';
+                       $this->TCAcachedExtras[$tN]['l10n_mode'][$fN] = 'exclude';
                }
                if (is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['settingLanguage_postProcess'])) {
                        $_params = array();
index ef1a47d..90a4c04 100644 (file)
@@ -384,10 +384,7 @@ class PageRepository {
                                                                }
                                                                foreach ($row as $fN => $fV) {
                                                                        if ($fN != 'uid' && $fN != 'pid' && isset($olrow[$fN])) {
-                                                                               if (
-                                                                                       $GLOBALS['TCA'][$table]['columns'][$fN]['l10n_mode'] != 'exclude'
-                                                                                       && ($GLOBALS['TCA'][$table]['columns'][$fN]['l10n_mode'] != 'mergeIfNotBlank' || strcmp(trim($olrow[$fN]), ''))
-                                                                               ) {
+                                                                               if ($GLOBALS['TSFE']->TCAcachedExtras[$table]['l10n_mode'][$fN] != 'exclude' && ($GLOBALS['TSFE']->TCAcachedExtras[$table]['l10n_mode'][$fN] != 'mergeIfNotBlank' || strcmp(trim($olrow[$fN]), ''))) {
                                                                                        $row[$fN] = $olrow[$fN];
                                                                                }
                                                                        } elseif ($fN == 'uid') {
index cab732b..55b0815 100644 (file)
@@ -105,13 +105,15 @@ class EidUtility {
                // but in fact it is not loaded. The check below ensure that
                // TCA is still loaded if such bad extensions are installed
                if (!is_array($GLOBALS['TCA']) || !isset($GLOBALS['TCA']['pages'])) {
-                       \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->loadExtensionTables(TRUE);
+                       // Load TCA using TSFE
+                       self::getTSFE()->includeTCA(FALSE);
                }
        }
 
        /**
         * Makes TCA for the extension available inside eID. Use this function if
-        * you need not to include the whole $GLOBALS['TCA'].
+        * you need not to include the whole $GLOBALS['TCA']. However, you still need to call
+        * \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA() if you want to access column array!
         *
         * @param string $extensionKey Extension key
         * @return void
index c57c3f8..997e441 100644 (file)
@@ -111,6 +111,7 @@ class AdminPanelView {
        public function getAdminPanelHeaderData() {
                $result = '';
                // Include BE styles
+               $GLOBALS['TSFE']->includeTCA();
                if (!empty($GLOBALS['TBE_STYLES']['stylesheets']['admPanel'])) {
                        $result = '<link rel="stylesheet" type="text/css" href="' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl($GLOBALS['TBE_STYLES']['stylesheets']['admPanel'])) . '" />';
                }
@@ -663,4 +664,4 @@ class AdminPanelView {
 }
 
 
-?>
\ No newline at end of file
+?>
index b40accd..0c9c9f2 100644 (file)
@@ -1590,6 +1590,7 @@ class ImportExport {
                        if (is_array($this->import_mapId[$table]) && isset($this->import_mapId[$table][$uid])) {
                                $thisNewUid = \TYPO3\CMS\Backend\Utility\BackendUtility::wsMapId($table, $this->import_mapId[$table][$uid]);
                                if (is_array($this->dat['records'][$table . ':' . $uid]['rels'])) {
+                                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                                        // Traverse relation fields of each record
                                        foreach ($this->dat['records'][$table . ':' . $uid]['rels'] as $field => $config) {
                                                switch ((string) $config['type']) {
@@ -1692,6 +1693,7 @@ class ImportExport {
                                foreach ($recs as $uid => $thisRec) {
                                        // If there are soft references defined, traverse those:
                                        if (isset($GLOBALS['TCA'][$table]) && is_array($thisRec['softrefs'])) {
+                                               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                                                // First traversal is to collect softref configuration and split them up based on fields. This could probably also have been done with the "records" key instead of the header.
                                                $fieldsIndex = array();
                                                foreach ($thisRec['softrefs'] as $softrefDef) {
index 4612e19..d09ea3c 100755 (executable)
@@ -3,6 +3,7 @@ if (!defined('TYPO3_MODE')) {
        die('Access denied.');
 }
 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPlugin(array('LLL:EXT:indexed_search/locallang.php:mod_indexed_search', $_EXTKEY));
+\TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('tt_content');
 $TCA['tt_content']['types']['list']['subtypes_excludelist'][$_EXTKEY] = 'layout,select_key,pages';
 // Registers the Extbase plugin to be listed in the Backend.
 if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('extbase')) {
index 95da75d..0be034d 100644 (file)
@@ -6475,6 +6475,9 @@ REMOTE_ADDR was \'' . \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REMOTE
         */
        public function includeTCA() {
                \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->loadExtensionTables(FALSE);
+               foreach ($GLOBALS['TCA'] as $table => $conf) {
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
+               }
        }
 
        /**********************
index ca2f9bb..f8068ec 100644 (file)
@@ -461,6 +461,8 @@ In effect you can therefore have, say, a "stable" version of an extension instal
 
 &lt;b&gt;Module+:&lt;/b&gt; The extension adds itself to the function menu of an existing backend module.
 
+&lt;b&gt;loadTCA:&lt;/b&gt; The extension includes a function call to t3lib_div::loadTCA for loading a table. This potentially means that the system is slowed down, because the full table description of some table is always included. However there probably is a good reason for this to happen. Probably the extension tries to manipulate the TCA-config for an existing table in order to extend it.
+
 &lt;b&gt;TCA:&lt;/b&gt; The extension contains configuration of a table in $TCA.
 
 &lt;b&gt;Plugin:&lt;/b&gt; The extension adds a frontend plugin to the plugin list in Content Element type "Insert Plugin".
index ad71e11..b6573ee 100644 (file)
@@ -99,6 +99,7 @@ Cleaning XML for FlexForm fields.
         * @todo Define visibility
         */
        public function main_parseTreeCallBack($tableName, $uid, $echoLevel, $versionSwapmode, $rootIsVersion) {
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($tableName);
                foreach ($GLOBALS['TCA'][$tableName]['columns'] as $colName => $config) {
                        if ($config['config']['type'] == 'flex') {
                                if ($echoLevel > 2) {
index 1a29b6d..4a799d0 100644 (file)
@@ -122,6 +122,9 @@ class ConfigurationView {
                        $arrayBrowser->varName = '$TYPO3_CONF_VARS';
                        break;
                case 1:
+                       foreach ($GLOBALS['TCA'] as $table => $config) {
+                               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
+                       }
                        $theVar = $GLOBALS['TCA'];
                        \TYPO3\CMS\Core\Utility\GeneralUtility::naturalKeySortRecursive($theVar);
                        $arrayBrowser->varName = '$TCA';
@@ -211,6 +214,14 @@ class ConfigurationView {
                                if ($var === '$TCA') {
                                        // check if we are editing the TCA
                                        preg_match_all('/\\[\'([^\']+)\'\\]/', $line, $parts);
+                                       if ($parts[1][1] !== 'ctrl') {
+                                               // anything else than ctrl section requires to load TCA
+                                               $loadTCA = 'TYPO3\\CMS\\Core\\Utility\\GeneralUtility::loadTCA(\'' . $parts[1][0] . '\');';
+                                               if (strpos($extTables, $loadTCA) === FALSE) {
+                                                       // check if the loadTCA statement is not already present in the file
+                                                       $changedLine = $loadTCA . LF . $changedLine;
+                                               }
+                                       }
                                }
                                // insert line in extTables.php
                                $extTables = preg_replace('/<\\?php|\\?>/is', '', $extTables);
index 0a80092..fa59be1 100644 (file)
@@ -17,12 +17,14 @@ $tempColumns = array(
        )
 );
 // Add new columns to be_users table
+\TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('be_users');
 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('be_users', $tempColumns, FALSE);
 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('be_users', 'tx_openid_openid;;;;1-1-1', '', 'after:username');
 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('be_users', 'EXT:' . $_EXTKEY . '/locallang_csh.xml');
 // Prepare new columns for fe_users table
 $tempColumns['tx_openid_openid']['config']['eval'] = 'trim,nospace,uniqueInPid';
 // Add new columns to fe_users table
+\TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('fe_users');
 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('fe_users', $tempColumns, FALSE);
 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToAllPalettesOfField('fe_users', 'username', 'tx_openid_openid');
 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('fe_users', 'EXT:' . $_EXTKEY . '/locallang_csh.xml');
index d943e15..9f994c0 100644 (file)
@@ -388,6 +388,8 @@ class AbstractDatabaseRecordList extends \TYPO3\CMS\Backend\RecordList\AbstractR
                        // Checking if the table should be rendered:
                        // Checks that we see only permitted/requested tables:
                        if ((!$this->table || $tableName == $this->table) && (!$this->tableList || \TYPO3\CMS\Core\Utility\GeneralUtility::inList($this->tableList, $tableName)) && $GLOBALS['BE_USER']->check('tables_select', $tableName)) {
+                               // Load full table definitions:
+                               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($tableName);
                                // Don't show table if hidden by TCA ctrl section
                                $hideTable = $GLOBALS['TCA'][$tableName]['ctrl']['hideTable'] ? TRUE : FALSE;
                                // Don't show table if hidden by pageTSconfig mod.web_list.hideTables
@@ -622,6 +624,8 @@ class AbstractDatabaseRecordList extends \TYPO3\CMS\Backend\RecordList\AbstractR
                        $result = ' AND 0=1';
                        $searchableFields = $this->getSearchFields($table);
                        if (count($searchableFields) > 0) {
+                               // Loading full table description - we need to traverse fields:
+                               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                                if (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($this->searchString)) {
                                        $whereParts = array(
                                                'uid=' . $this->searchString
@@ -877,6 +881,7 @@ class AbstractDatabaseRecordList extends \TYPO3\CMS\Backend\RecordList\AbstractR
                $fieldListArr = array();
                // Check table:
                if (is_array($GLOBALS['TCA'][$table]) && isset($GLOBALS['TCA'][$table]['columns']) && is_array($GLOBALS['TCA'][$table]['columns'])) {
+                       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                        if (isset($GLOBALS['TCA'][$table]['columns']) && is_array($GLOBALS['TCA'][$table]['columns'])) {
                                // Traverse configured columns and add them to field array, if available for user.
                                foreach ($GLOBALS['TCA'][$table]['columns'] as $fN => $fieldValue) {
index e985a77..5f57bd7 100644 (file)
@@ -246,6 +246,8 @@ class DatabaseRecordList extends \TYPO3\CMS\Recordlist\RecordList\AbstractDataba
         * @todo Define visibility
         */
        public function getTable($table, $id, $rowlist) {
+               // Loading all TCA details for this table:
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                // Init
                $addWhere = '';
                $titleCol = $GLOBALS['TCA'][$table]['ctrl']['label'];
@@ -986,6 +988,8 @@ class DatabaseRecordList extends \TYPO3\CMS\Recordlist\RecordList\AbstractDataba
                if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('version') && isset($row['_ORIG_uid'])) {
                        $rowUid = $row['_ORIG_uid'];
                }
+               // Initialize:
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                $cells = array();
                // If the listed table is 'pages' we have to request the permission settings for each page:
                if ($table == 'pages') {
@@ -1294,6 +1298,7 @@ class DatabaseRecordList extends \TYPO3\CMS\Recordlist\RecordList\AbstractDataba
         */
        public function fieldSelectBox($table, $formFields = 1) {
                // Init:
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA($table);
                $formElements = array('', '');
                if ($formFields) {
                        $formElements = array('<form action="' . htmlspecialchars($this->listURL()) . '" method="post">', '</form>');
index 1be670d..fed03c0 100644 (file)
@@ -4,6 +4,8 @@ if (!defined('TYPO3_MODE')) {
 }
 // Adding soft reference keys in tt_content configuration
 // htmlArea RTE soft reference keys are inserted in front so that their tokens are inserted first
+\TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('tt_content');
+\TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('pages');
 $GLOBALS['TCA']['tt_content']['columns']['header']['config']['softref'] = 'typolink_tag' . ($GLOBALS['TCA']['tt_content']['columns']['header']['config']['softref'] ? ',' . $GLOBALS['TCA']['tt_content']['columns']['header']['config']['softref'] : '');
 $tempTables = array('pages', 'tt_content');
 foreach ($tempTables as $table) {
index 4e909de..54913cb 100644 (file)
@@ -2,6 +2,7 @@
 if (!defined('TYPO3_MODE')) {
        die('Access denied.');
 }
+\TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('fe_users');
 $GLOBALS['TCA']['fe_users']['columns']['password']['config']['max'] = 100;
 if (\TYPO3\CMS\Saltedpasswords\Utility\SaltedPasswordsUtility::isUsageEnabled('FE')) {
        // Get eval field operations methods as array keys
@@ -14,6 +15,7 @@ if (\TYPO3\CMS\Saltedpasswords\Utility\SaltedPasswordsUtility::isUsageEnabled('F
        $GLOBALS['TCA']['fe_users']['columns']['password']['config']['eval'] = implode(',', array_keys($operations));
        unset($operations);
 }
+\TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('be_users');
 $GLOBALS['TCA']['be_users']['columns']['password']['config']['max'] = 100;
 if (\TYPO3\CMS\Saltedpasswords\Utility\SaltedPasswordsUtility::isUsageEnabled('BE')) {
        // Get eval field operations methods as array keys
index c65054d..175f23e 100644 (file)
@@ -33,6 +33,7 @@ $tempField = array(
                )
        )
 );
+\TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('sys_template');
 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('sys_template', $tempField, 1);
 \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('sys_template', 'include_static;;2;;5-5-5', '', 'before:includeStaticAfterBasedOn');
 ?>
\ No newline at end of file
index 4031a6e..34dc1b5 100644 (file)
@@ -580,6 +580,8 @@ class user_feAdmin {
                                $fileNameList[] = ($fI2['basename'] . '|') . $infoArr['name'];
                        } else {
                                $this->createFileFuncObj();
+                               $GLOBALS['TSFE']->includeTCA();
+                               t3lib_div::loadTCA($this->theTable);
                                if (is_array($GLOBALS['TCA'][$this->theTable]['columns'][$theField])) {
                                        $uploadPath = $GLOBALS['TCA'][$this->theTable]['columns'][$theField]['config']['uploadfolder'];
                                }
@@ -899,6 +901,8 @@ class user_feAdmin {
        public function deleteFilesFromRecord($uid) {
                $table = $this->theTable;
                $rec = $GLOBALS['TSFE']->sys_page->getRawRecord($table, $uid);
+               $GLOBALS['TSFE']->includeTCA();
+               t3lib_div::loadTCA($table);
                $iFields = array();
                foreach ($GLOBALS['TCA'][$table]['columns'] as $field => $conf) {
                        if ($conf['config']['type'] == 'group' && $conf['config']['internal_type'] == 'file') {
index 65ba022..a4c5f8d 100644 (file)
@@ -9,6 +9,7 @@ if (TYPO3_MODE === 'BE') {
        $TYPO3_CONF_VARS['BE']['AJAX']['T3Editor_TSrefLoader::getTypes'] = 'EXT:t3editor/Classes/ts_codecompletion/class.tx_t3editor_tsrefloader.php:TYPO3\\CMS\\T3Editor\\TypoScriptReferenceLoader->processAjaxRequest';
        $TYPO3_CONF_VARS['BE']['AJAX']['T3Editor_TSrefLoader::getDescription'] = 'EXT:t3editor/Classes/ts_codecompletion/class.tx_t3editor_tsrefloader.php:TYPO3\\CMS\\T3Editor\\TypoScriptReferenceLoader->processAjaxRequest';
        $TYPO3_CONF_VARS['BE']['AJAX']['CodeCompletion::loadTemplates'] = 'EXT:t3editor/Classes/ts_codecompletion/class.tx_t3editor_codecompletion.php:TYPO3\\CMS\\T3Editor\\CodeCompletion->processAjaxRequest';
+       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('tt_content');
        // Add the t3editor wizard on the bodytext field of tt_content
        $TCA['tt_content']['columns']['bodytext']['config']['wizards']['t3editor'] = array(
                'enableByTypeConfig' => 1,
index 8293394..a22a560 100644 (file)
@@ -89,6 +89,7 @@ if (TYPO3_MODE == 'BE' || TYPO3_MODE == 'FE' && isset($GLOBALS['BE_USER'])) {
        // Changing icon for filemounts, needs to be done here as overwriting the original icon would also change the filelist tree's root icon
        $TCA['sys_filemounts']['ctrl']['iconfile'] = '_icon_ftp_2.gif';
        // Adding flags to sys_language
+       \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('sys_language');
        $TCA['sys_language']['ctrl']['typeicon_column'] = 'flag';
        $TCA['sys_language']['ctrl']['typeicon_classes'] = array(
                'default' => 'mimetypes-x-sys_language',
index 20783ef..097e7f8 100644 (file)
@@ -178,6 +178,7 @@ class TypoScriptTemplateInformationModuleFunctionController extends \TYPO3\CMS\B
                $this->pObj->MOD_MENU['includeTypoScriptFileContent'] = TRUE;
                $edit = $this->pObj->edit;
                $e = $this->pObj->e;
+               \TYPO3\CMS\Core\Utility\GeneralUtility::loadTCA('sys_template');
                // Checking for more than one template an if, set a menu...
                $manyTemplatesMenu = $this->pObj->templateMenu();
                $template_uid = 0;