У меня есть форма для обновления сущности.Когда я пытаюсь вызвать updateAction()
, он возвращает ошибку.Какова причина?Как я могу решить проблему?
form.html:
<f:form action="update" enctype="multipart/form-data" name="multimedia" object="{multimedia}" id="multimediaEditForm">
<f:render partial="Multimedia/FormFields" arguments="{_all}" />
</f:form>
updateAction:
/**
* Setting TypeConverter option for file upload
*/
public function initializeUpdateAction()
{
$this->setTypeConverterConfiguration('multimedia');
}
/**
* action update
*
* @TYPO3\CMS\Extbase\Annotation\Validate("PITS\RccMultimedia\Domain\Validator\MultimediaValidator", param="$multimedia")
* @return void
*/
public function updateAction()
{
$updatedBy = $GLOBALS['TSFE']->fe_user->user ;
$userObject = $this->userRepository->findByUid($updatedBy['uid']);
$multimedia = $this->request->getArgument('multimedia');
}
/**
* For mapping properties to object
*/
protected function setTypeConverterConfiguration($argument)
{
$uploadConfiguration = array(
UploadedFileReferenceConverter::CONFIGURATION_ALLOWED_FILE_EXTENSIONS => 'jpg,jpeg,html,css,html,png,bmp,txt,doc,docx,xlf,ico,gif,ogg,tiff,mp4,wmv,webm,movie,pdf',
UploadedFileReferenceConverter::CONFIGURATION_UPLOAD_FOLDER => 'fileadmin/user_upload',
);
/** @var PropertyMappingConfiguration $newFileConfiguration */
$newFileConfiguration = $this->arguments[$argument]->getPropertyMappingConfiguration();
$newFileConfiguration->forProperty('multimediaFile')->setTypeConverterOptions('Vendor\\Multimedia\\Property\\TypeConverter\\UploadedFileReferenceConverter', $uploadConfiguration);
}
$this->arguments
возвращает пустое значение, но $this->request->getArgument('multimedia');
имеет значение.