Bug #18997
closed
TCAselectItem not working for all tables
Added by Oliver Weiss over 16 years ago.
Updated about 6 years ago.
Category:
Content Rendering
Description
The stdWrap feature TCAselectItem. is not working for tables, which come from own extensions. This is because the TCA array is not completely loaded in the TCAlookup function (class.tslib_content: Line 4977).
If t3lib_div::loadTCA($table); is added, it works.
page.10 = TEXT
page.10.value = 1
page.10.TCAselectItem.table = tt_news
page.10.TCAselectItem.field = type
page.10.TCAselectItem.delimiter = ,
does not work.
page.10 = TEXT
page.10.value = 1
page.10.TCAselectItem.table = pages
page.10.TCAselectItem.field = doktype
page.10.TCAselectItem.delimiter = ,
works.
(issue imported from #M8785)
Files
Well, the documentation says that for the Frontend you should use $TSFE->includeTCA(). If I read this thing correctly, it also loads the columns etc.
Anyway, so what I wanted to say is that the difference between includeTCA and t3lib-div::loadTCA() is that the first one loads the whole TCA and not just the ctrl part. And it worked on my side.
If there is a bug, we should probably fix includeTCA to make it work with extensions as well. Agreed?
I just have the same Problem. includeTCA doesn't load the columns-fields of my extension. But there is a trick:
includeTCA includes all what it finds in ext_tables.php. So I cut the part of my selectfield out of tca.php and pasted it in ext_tables.php of my ext-directory. Now includeTCA finds my column and it works.
But you're right...there should be a function in TYPO3 like readColumnsFromTCA($table) or something like that...
The documentation of tslib_fe->includeTCA() says: "To load full TCA for the table, use t3lib_div::loadTCA($tableName) after calling this function."
I attached a patch which adds t3lib_div::loadTCA($table);
committed to svn
4_4 rev 9018
trunk rev 9019
- Status changed from Resolved to Closed
Also available in: Atom
PDF