I have set up an extension with the current extension_builder in TYPO3 6.2.11. FAL File upload in the backend is not working.
extension_builder says that file upload isn't implemented at all in extbase, but as far as I understood (cf https://github.com/helhum/upload_example), this is regarding FE upload. Correct?
I only need completely regular BE file upload - select via "Create new relation" or "Select & upload files".
The direct upload fails with "Upload failed! A file with "*" extension is expected!" (or whatever extensions I specify in TCA).
The reference creation works, but the reference is lost after saving.
This screenshot shows the two tries before saving.
And after saving, empty again:
How do I make this work? Do I have to add extra code to the repo for saving the relation? Or might there be a basic setting missing?
For tt_content, FAL relations and upload work fine.
And: As a workaround, is it possible to use a regular "Pibase" 'type' => 'group','internal_type' => 'file'
field? But how would getters and setters in the model look then? Just like a regular string?
TCA:
'apprenticeship_document' => array(
'exclude' => 1,
'label' => 'LLL:EXT:stellen/Resources/Private/Language/locallang_db.xlf:tx_stellen_domain_model_institution.apprenticeship_document',
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
'apprenticeshipDocument',
array('maxitems' => 1),
'*'
),
),
Model as created by extension_builder:
/**
* apprenticeshipDocument
*
* @var \TYPO3\CMS\Extbase\Domain\Model\FileReference
*/
protected $apprenticeshipDocument = NULL;
/**
* Returns the apprenticeshipDocument
*
* @return \TYPO3\CMS\Extbase\Domain\Model\FileReference $apprenticeshipDocument
*/
public function getApprenticeshipDocument() {
return $this->apprenticeshipDocument;
}
/**
* Sets the apprenticeshipDocument
*
* @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $apprenticeshipDocument
* @return void
*/
public function setApprenticeshipDocument(\TYPO3\CMS\Extbase\Domain\Model\FileReference $apprenticeshipDocument) {
$this->apprenticeshipDocument = $apprenticeshipDocument;
}
I have also tried to use \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\TYPO3\CMS\Extbase\Domain\Model\FileReference>
instead of \TYPO3\CMS\Extbase\Domain\Model\FileReference $apprenticeshipDocument
, but that doesn't make a difference either.