Bug #54403

Resources remade when parent record updated

Added by Stephen Bungert over 1 year ago.

Status:New Start date:2013-12-13
Priority:Should have Due date:
Assigned To:- % Done:

0%

Category:-
Target version:-
Affected Flow version:Flow 2.0.0

Description

I have a book record, the book has an image record and this has a resource record.

Everytime I update my book the image's resource is re-made, a new resource record is created.

Here is the fluid template for the image fields

https://gist.github.com/riscos/7949892

in TYPO3\Flow\Resource\ResourceTypeConverter, a new Resource object is created using the submitted $source['submittedFile']['filename'] and $source['submittedFile']['resourcePointer']

These properties are created by the fluid file VH. If the actual file upload field is empty but these properties are there, shouldn't the resource object be returned from the resource repository instead of just creating a new resource?

The problem is gone if the resource file input is not in my form. I would like to keep the file input so that users can change the image. Surely if this file input is empty the resource should not be remade? The only alternative I see is, if there is a resource, don't show an upload input and make people delete the old file and save the book before letting them upload a new file.

Also available in: Atom PDF