-
Notifications
You must be signed in to change notification settings - Fork 51
Upload new image in update action #28
Comments
Same with my implementation, do you have any solutions? |
I have the same issuse but it seems more related to extbase. The converter works fine, you get the filereference but extbase don't switch the files. |
I would recommend to always use an object storage, which will then lead to the desired behavior. |
Hello, I have the same problem. I uploaded a new image and in database the sys_file_reference is changed but in the frontend output there es used the old one. Why? |
I encountered the same problem while running it in TYPO 8.7.19 and found out, that the problem happened during the conversion of the already uploaded resource inside the UploadViewHelper. While in TYPO 7.6, $this->getValueAttribute() returns the ID of the existing upload as a string, it returns an integer in TYPO 8. This leads to TYPO not setting it as the UID of the converted FileReference, thinking there is no attached resource AND creating a second relation instead of replacing it with the newly uploaded file. Long Story Short: Casting $resource to string before converting it did the trick for me. Maybe it helps some of you. protected function getUploadedResource()
{
// ...
return $this->propertyMapper->convert((string)$resource, 'TYPO3\\CMS\\Extbase\\Domain\\Model\\FileReference');
} |
This fixed the exact same issue for me - thank you very much. |
I'm trying to edit persisted record with a single image. The image was uploaded via FE. Unfortunately this is not working. A new image is uploaded but it's added to the relation instead of replacing it. The model has property of FileReference type, not ObjectStorage, as it should store only single image. However, when looking at the record in BE, I see 2 relations. Any idea what I may be doing wrong or how to fix it?
The text was updated successfully, but these errors were encountered: