Project

General

Profile

Actions

Bug #67042

closed

$TCA['random_table'] not available if target table is loaded below the extending extension in PackagesStates.php

Added by Arek van Schaijk over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
System/Bootstrap/Configuration
Target version:
-
Start date:
2015-05-20
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.5
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Hi,

I found out that $TCA['tt_address'] is not available yet in ext_tables.php of an extension which is loaded above tt_address in typo3conf/PackagesStates.php.
So \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns() does not add your TCA columns to the TCA which is loaded below your extension.

ext_tables.php:print_r($TCA['tt_address']); result when tt_address is loaded above my extension:

Array
(
    [ctrl] => Array
        (
            [label] => name
            [label_alt] => email
            [default_sortby] => ORDER BY name
            [tstamp] => tstamp
            [prependAtCopy] => LLL:EXT:lang/locallang_general.xml:LGL.prependAtCopy
            [delete] => deleted
            [title] => LLL:EXT:tt_address/locallang_tca.xml:tt_address
            [thumbnail] => image
            [enablecolumns] => Array
                (
                    [disabled] => hidden
                )

            [dynamicConfigFile] => C:/wamp/www/laportavacanze62.projects.netcreators.nl/typo3conf/ext/tt_address/tca.php
            [iconfile] => ../typo3conf/ext/tt_address/ext_icon.gif
            [searchFields] => name, first_name, middle_name, last_name, email
        )

    [interf....

ext_tables.php:var_dump($TCA['tt_address']); result in "null" when tt_address is loaded below my extension.


Eg. \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns() does not add tca columns if the target extension is loaded below your extending extension.

Actions #1

Updated by Arek van Schaijk over 9 years ago

Damn I messed up the context of the ticket but I think my point is clear ;)

Actions #2

Updated by Christian Kuhn over 9 years ago

Yeah. So, you have a dependency from your extension to tt_address. If you define this dependency in your ext_emconf.php, the PackageManager will take care that your extension is loaded after tt_address.

Actions #3

Updated by Christian Kuhn over 9 years ago

so basically, add tt_address as required extension in your ext_emconf, then unload and load the extension again via extension manager, and you will end up with your extension being loaded after tt_address in PackageStates.php

Actions #4

Updated by Christian Kuhn over 9 years ago

  • Status changed from New to Needs Feedback
Actions #5

Updated by Markus Klein over 9 years ago

and always use $GLOBALS['TCA'] instead of $TCA to access global variables.

Actions #6

Updated by Arek van Schaijk over 9 years ago

That makes sense but I have the dependency set up and still did not manage to get tt_address above my extension loaded (even not after reinstalling the extension in the ExtMngr).

But the installation where I'm currently working on is a big mess so I can't confirm now if any other thing is messing me up right now.

When thinking about it, it's clear for me that it can't be a core issue. So you can close this ticket for now.

Thanks for the quick feedback :)

Actions #7

Updated by Christian Kuhn over 9 years ago

Your dependency definition should like like that in your extension (adapt the lower / upper version numbers to fit to tt_address):

$EM_CONF[$_EXTKEY] = array(
    'title' => 'My awesome ext that depends on tt_address',
... // more stuff here in between
    'version' => '1.2.3',
    'constraints' => array(
        'depends' => array(
            'tt_address' => '1.2.23-2.5.42',
        ),
        'conflicts' => array(),
        'suggests' => array(),
    ),
);

Core version 6.2 series had some edge case issues in early releases, but with younger bugfix releases we're pretty sure the dependency resolving and load order stuff works well, since this is also covered pretty well by a group of tests.

Actions #8

Updated by Christian Kuhn over 9 years ago

  • Status changed from Needs Feedback to Closed

closing as requested.

Actions

Also available in: Atom PDF