Bug #27922
closed
Extended TCA not loaded by CSC in function render_uploads
Added by Georg Schönweger over 13 years ago.
Updated almost 12 years ago.
Category:
Content Rendering
Description
Bug:
css_styled_content doesn't call $GLOBALS['TSFE']->includeTCA() before running t3lib_div::loadTCA('tt_content'). Thus only the default tt_content TCA definitions are loaded. Any extensions extending tt_content TCA is ignored.
Background:
Consider you want to secure "File Links" content elements (jumpurl_secure). By default all files inserted in "media" field of "File Links" CE are copied to "uploads/media". Denying access to this folder can lead to problems. A solution could be to extend tt_content TCA and use a new field "my_field" ONLY for "File Links" CE with a separate uploadfolder. This uploadfolder can then be protected e.g. by a .htaccess file.
Currently it is not possible to do this because the extended TCA is not loaded by CSC!
Side effects:
This will add some performance penalty to it, because it will load the TCA for "every" extension. Which is fine, because any extension might want to add additional fields for tt_content.
Files
- Subject changed from extendet TCA not loaded by CSC in function render_uploads to Extended TCA not loaded by CSC in function render_uploads
checked current master - i think that is already in? - isn't it? (see line 279 in attachment)
Used following changeset:
commit acfa3ca029f429ac64bfce94c6f535e4c7690fb5
Author: Sebastian Michaelsen <sebastian.....@.....com>
Date: Mon Jul 11 10:48:40 2011 +0200
[BUGFIX] t3lib_div::debugRows doesn't return data
Bug should be closed - agree?
no, $GLOBALS['TSFE']->includeTCA(); isn't executed before t3lib_div::loadTCA('tt_content'); in the file attached by you.
I don't think that includeTCA() is called inside t3lib_div::loadTCA(). In the doc part of function loadTCA it is written "For complete TCA use $GLOBALS['TSFE']->includeTCA() instead."
On the other hand in doc part of function includeTCA it is written "To load full TCA for the table, use t3lib_div::loadTCA($tableName) after calling this function." ... So i'm not sure if both (includeTCA AND loadTCA) have to be called. We discussed that in the dev-mailinglist (http://lists.typo3.org/pipermail/typo3-dev/2011-July/043613.html) and loading both should be the safest way. Maybe the doc parts of the two functions should be changed so that there is no more confusion.
Would be great if you could push the changes, i'm not used to git/gerrit and i'm little bit busy at the moment.
thanks,
Georg
Patch set 1 of change Icd68a4126f5633a4802822556c6e4f608e604f0f has been pushed to the review server.
It is available at http://review.typo3.org/3420
This bug probably tries to address the general problem from the wrong side. I guess, TCA needs a more complete rewrite with caching of the parsed complete TCA. Then, access to the TCA should be easier.
- Target version changed from 4.5.4 to 4.5.6
- Target version changed from 4.5.6 to 4.5.8
- Status changed from New to Under Review
- Target version changed from 4.5.8 to 4.5.12
- Status changed from Under Review to Closed
Also available in: Atom
PDF