[TYPO3-core] Another issue with multiple category selectors
François Suter
fsu-lists at cobweb.ch
Thu Oct 3 22:42:11 CEST 2013
Hi all,
I just came across another issue related to the recent new feature of
being able to add several category selectors to the same table. The
default name for such a category selector is "categories". Now if you
add another such field and name it like "tx_myextension_categories", it
will override "categories" because of the way
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes()
behaves.
If the addition of "categories" comes after the addition of
"tx_myextension_categories" (which is the case - for example - for the
"pages" table, because the default categorization (set in
[SYS][defaultCategorizedTables]) comes after calls to
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::makeCategorizable()), then
"categories" will be matched inside "tx_myextension_categories" and
addToAllTCAtypes() will assume that the field already exists.
The really good solution would be to improve addToAllTCAtypes() so that
it's more clever, but it would also certainly require more processing.
The middle way could be to say that the default category selector is
called "default_categories" (or some such) which would IMO strongly
lower the chances of overriding it with another field name.
What do you think?
Cheers
--
Francois Suter
Work: Cobweb Development Sarl - http://www.cobweb.ch
TYPO3: Help the project! - http://typo3.org/contribute/
Appreciate my work? Support me -
http://www.monpetitcoin.com/en/francois/support-me/
More information about the TYPO3-team-core
mailing list