rendertype inputlink for huge files without copying the file - typo3

I need a tca field with a link to huge files (100-900 MB). I used this TCA:
'config' => [
'type' => 'input',
'renderType' => 'inputLink',
'fieldControl' => [
'linkPopup' => [
'options' => [
'blindLinkOptions' => 'mail,page,spec,url,folder',
'blindLinkFields' => 'class,params,target,title',
],
],
],
]
It works but when I save the data TYPO3 seems to copy the file and I get the error message that the limit of 50 MB is exceeded. But I need only a simple link to the file.
In version 7 it worked with this code:
'config' => array (
'type' => 'input',
'size' => '100',
'max' => '255',
'eval' => 'trim',
'wizards' => array(
'_PADDING' => 2,
'link' => array(
'type' => 'popup',
'title' => 'LLL:EXT:cms/locallang_ttc.xml:header_link_formlabel',
'icon' => 'link_popup.gif',
'module' => array(
'name' => 'wizard_element_browser',
'urlParameters' => array(
'mode' => 'wizard',
'act' => 'file'
)
),
'JSopenParams' => 'height=300,width=500,status=0,menubar=0,scrollbars=1'
)
),
)
but it doesn't work anymore in TYPO3 8.
How can i fix the problem?
Correction:
I am sorry but I was wrong. The whole question is wrong: The above configuration works as expected, it does not copy the file, it only links to the file. I made another error which leads to a misunderstanding of my real problem.
Sorry for the noise ...
In order to close the topic I will mark the answer as correct. In some way it was because it gave me a good hint.

Take a look to FAL. Here the files are only referenced to the orgin file.
'image' => array(
'label' => 'LLL:EXT:lang/locallang_general.xlf:LGL.images',
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig('image', array(
'appearance' => array(
'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference'
),
// custom configuration for displaying fields in the overlay/reference table
// to use the imageoverlayPalette instead of the basicoverlayPalette
'foreign_types' => array(
...
)
), $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'])
),

Related

TYPO3: Issue with File upload and File reference

I have "Book" model with a "pdf" and "image" property. Both property are files that can be uploaded by the user.
I followed Helhum's example for the image upload and it works fine.
I tried to do the same for the "pdf" field but it doesn't work. The file is being uploaded, the file ID is also saved in the database but the file reference is missing.
Here is a dump of the "Book" object after the upload:
pdf => NULL
image => Vendor\MyExt\Domain\Model\FileReference
In the "setTypeConverterConfigurationForImageUpload" function I added this line the pdf property:
$newExampleConfiguration->forProperty('pdf')
->setTypeConverterOptions(
'Vendor\\MyExt\\Property\\TypeConverter\\UploadedFileReferenceConverter',
$uploadConfiguration
);
I am probably missing something but I don't what.
EDIT:
I found the issue thanks to Heinz and Ghanshyam. It was a mistake in the TCA.
Here is how my working TCA looks like:
'image' => array(
'exclude' => 1,
'label' => 'Image',
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig('image', array(
'appearance' => array(
'elementBrowserType' => 'file',
'elementBrowserAllowed' => $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'],
),
'minitems' => 0,
'maxitems' => 1,
// custom configuration for displaying fields in the overlay/reference table
// to use the imageoverlayPalette instead of the basicoverlayPalette
'foreign_match_fields' => array(
'fieldname' => 'image',
'tablenames' => 'tx_myext_domain_model_book',
'table_local' => 'sys_file',
),
'foreign_types' => array(
'0' => array(
'showitem' => '
--palette--;;imagePalette,
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
--palette--;;filePalette',
),
),
), $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']),
),

DisplayCond equation between two values

I am trying to figure it out how can I display field in TCA when two values of other fields are same?
My configuration is that I have two fields new and old and one field second. I would like to reach that field second is displayed when new and old are same or new=1 (this is working).
$fields[] = array(
'new' => array(
'label' => "New ID",
'exclude' => 1,
'config' => array(
'type' => 'input'
)
),
);
$fields[] = array(
'old' => array(
'label' => "old ID",
'exclude' => 1,
'config' => array(
'type' => 'input'
)
),
);
$fields[] = array(
'second' => array(
'exclude' => 1,
'displayCond' => array(
'OR' => array(
'FIELD:new:=:1',
'FIELD:new:=FIELD:old'
)
),
'config' => array(
'type' => 'input',
'size' => '255',
)
),
);
The syntax ''FIELD:new:=FIELD:old' is not allowed by the display condition parser (which i rewrote in core v8). Thus, you can not compare the values of two different fields directly, and you are not able to solve your issue on a display condition level.
You may solve your issue by adding a new data provider (probably after the EvaluateDisplayConditionDataProvider) that removes your column in your special case, see https://docs.typo3.org/typo3cms/CoreApiReference/ApiOverview/FormEngine/Index.html for more docs.

TYPO3 Rich Text Editor (RTE) in fullscreen mode works, but not in my Extension?

At my standard content elements text & media the fullscreen mode for RTE (htmlarea, Rich-Text-Editor) is working fine.
But - I've wrote an extension (via extension builder) and if I try to use the RTE in fullscreen, I've got the following error:
Module wizard_rich_text_editor is not configured
Here's my TCA, where's my error? The 'TYPO3-RTE' is working fine, so there must be an error in my following code. What do you think?
'description' => array(
'exclude' => 1,
'label' => 'LLL:EXT:xyz/Resources/Private/Language/locallang_db.xlf:tx_xyz_domain_model_product.description',
'config' => array(
'type' => 'text',
'cols' => 40,
'rows' => 15,
'eval' => 'trim',
'wizards' => array(
'RTE' => array(
'icon' => 'wizard_rte2.gif',
'notNewRecords'=> 1,
'RTEonly' => 1,
'module' => array(
'name' => 'wizard_rich_text_editor',
'urlParameters' => array(
'mode' => 'wizard',
'act' => 'wizard_rte.php'
)
),
'title' => 'LLL:EXT:cms/locallang_ttc.xlf:bodytext.W.RTE',
'type' => 'script'
)
)
),
),
Does anyone know the problem? Thanks for your help.
Regards,
Stefan
A working example for TYPO3 7.x and 8 is
'bodytext' => [
'exclude' => 0,
'l10n_mode' => 'noCopy',
'label' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:bodytext_formlabel',
'config' => [
'type' => 'text',
'cols' => 30,
'rows' => 5,
'softref' => 'rtehtmlarea_images,typolink_tag,images,email[subst],url',
'wizards' => [
'_PADDING' => 2,
'RTE' => [
'notNewRecords' => 1,
'RTEonly' => 1,
'type' => 'script',
'title' => 'Full screen Rich Text Editing',
'icon' => 'EXT:backend/Resources/Public/Images/FormFieldWizard/wizard_rte.gif',
'module' => [
'name' => 'wizard_rte',
],
],
],
]
],
The name should be wizard_rte.

TYPO3 own extension using RTE

Im writing my own extension. Now i like my textarea to be edited i RTE. I tried some configurations from web and i cannot make it work..
Part of my TCA:
'tasks' => array(
'exclude' => 0,
'label' => 'LLL:EXT:jobs/Resources/Private/Language/locallang_db.xlf:tx_jobs_domain_model_joboffer.tasks',
'config' => array(
'type' => 'text',
'cols' => 40,
'rows' => 15
),
'defaultExtras' => 'richtext[]'
),
Like here: http://docs.typo3.org/typo3cms/CoreApiReference/Rte/InTheBackend/Index.html
NOT WORKING :(
I also tried similar to this: http://typo3blogger.de/der-t3editor-im-tca/ and also cannot make it work. In cms i always see simple textarea. Any ideas how to plug it in?
my TCA script:
'types' => array(
'1' => array('showitem' => 'sys_language_uid;;;;1-1-1, l10n_parent, l10n_diffsource, hidden;;1, add_date, reference_number, position, link_url, localization, title, requirements;;;richtext:rte_transform[mode=ts_links], tasks;;;richtext::rte_transform[flag=rte_disabled|mode=ts_css], offer;;;richtext:rte_transform[mode=ts_links], category, --div--;LLL:EXT:cms/locallang_ttc.xlf:tabs.access, starttime, endtime'),
),
and columns:
'tasks' => array(
'exclude' => 0,
'label' => 'LLL:EXT:jobs/Resources/Private/Language/locallang_db.xlf:tx_jobs_domain_model_joboffer.tasks',
'config' => array(
'type' => 'text',
'cols' => 40,
'rows' => 15
),
'defaultExtras' => 'richtext[]'
),
If you field is called tasks, you need in your *showitem** section this code:
tasks;;;richtext::rte_transform[flag=rte_disabled|mode=ts_css],
see e.g. https://github.com/TYPO3-extensions/news/blob/master/Configuration/TCA/tx_news_domain_model_news.php#L612

How to make file_reference in extbase extension in TYPO3 6.1 work?

I have set up a small extension with the extension builder containing a few fields, one of which is the internal_type: 'file_reference'.
'dokument' => array(
'exclude' => 0,
'label' => 'LLL:EXT:publikationen/Resources/Private/Language/locallang_db.xlf:tx_publikationen_domain_model_publikation.dokument',
'config' => array(
'type' => 'group',
'internal_type' => 'file_reference',
//'uploadfolder' => 'uploads/tx_publikationen',
'allowed' => '*',
'disallowed' => 'php',
'size' => 5,
),
),
The field appears in the backend, but the Element browser is unable to show any files to select:
If I remove the "bparams" parameter from the URL shown above, it is able to see the files that are there.
How can this be brought to work?
FAL fields require complicated configuration. To make that easier, there is a function returning the TCA config for such a field.
Its usage for a field that allows only one file looks like this:
'dokument' => array(
'label' => 'LLL:EXT:publikationen/Resources/Private/Language/locallang_db.xlf:tx_publikationen_domain_model_publikation.dokument',
'exclude' => 0,
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
'dokument',
array(
'maxitems' => 1,
'minitems' => 1,
'appearance' => array(
'enabledControls' => array(
'dragdrop' => FALSE,
'localize' => FALSE,
),
),
)
),
),
A look into the source code of that function makes me not want to do that manually.