[TYPO3-dev] secure downloads - css_styled_content
Georg Schönweger
georg.schoenweger at gmail.com
Wed Jul 6 10:46:11 CEST 2011
Hi Matthias,
sry if i was not clear enough, see my notes below;
Am 06.07.2011 10:23, schrieb Mathias Schreiber [wmdb]:
> Am 06.07.11 09:01, schrieb Georg Schönweger:
>> Now i looked in to source code of css_styled_content and saw that i can
>> define another upload field by using the TS-Code;
>> tt_content.uploads.20.field = my_field
>>
>> So far, so good. I created an extension which adds a new field to
>> tt_content. And here is my problem; It seems that the TCA definitions
>> from my extension are loaded AFTER css_styled_content. So i can't make
>> use of my_field.
>
> TCA has nothing to do with Tposcript code.
> You can access fields that don't exist in TCA as long as they are in
> the database.
>
> So I'd opt for "you have something wrong in your TS.
Yes i can access the field. The problem is that TCA entry "uploadfolder"
which is used in css_styled_content for creating the links to the files
is not available for my extending_tt_content_field... Because i'm using
a different uploadfolder than default the filelinks of course aren't
rendered at all..
this is the code from css_styled_content (around Line 302 - Typo3 4.5.3):
t3lib_div::loadTCA('tt_content');
$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
$path =
$GLOBALS['TCA']['tt_content']['columns'][$field]['config']['uploadfolder']
.'/';
}
In my case $path is always "uploads/media/", but my field stores the
files in a different uploadfolder defined in TCA.
>
>> I changed "extList" and "extList_FE" in typo3conf/localconf.php and put
>> my extension at first position before css_styled_content, but this has
>> no effect.
>
>> In sr_feuser_register they have the same problem and solved it by
>> providing a Hook;
>
> These TCA hooks are for extending the TCA.
> The TCA just defines how fields show up in the BE.
> So you're on the wrong track here.
"uploadfolder" from TCA is also used for FE-rendering, see above.
>
> cheers
> Mathias
>
regards,
Georg
More information about the TYPO3-dev
mailing list