Bug #25966

ResourcePointer breaks if you upload the same file twice

Added by Andreas Förthner over 4 years ago. Updated about 4 years ago.

Status:Resolved Start date:2011-04-14
Priority:Must have Due date:
Assigned To:Sebastian Kurfuerst % Done:

100%

Category:Persistence
Target version:TYPO3 Flow Base Distribution - 1.0 beta 1
PHP Version: Complexity:
Has patch: Affected Flow version:

Description

As ResourcePointer is no valueobject (for doctrine) anymore, the resource manager creates a second one for the same file, if you upload it twice. Now the sha1 hash is the identifier of the ResourcePointer, and therefore we get a duplicate entry error from the database as we have twice the "same" object.


Related issues

related to Conference Management - Task #26667: Fix Image Upload from plugin Resolved 2011-05-06
related to TYPO3.Flow - Bug #26886: Uploaded resources get lost on validation errors Resolved 2011-05-18
blocks Conference Management - Story #26663: Solve FLOW3/Phoenix bugs for sprint "Call for Papers" Resolved 2011-05-06

Associated revisions

Revision 3fd0ed84
Added by Sebastian Kurfuerst about 4 years ago

[+BUGFIX] (Resource): Fix file upload

  • ResourcePointer instances are now automatically created (or fetched)
    as soon as an image is uploaded.
  • the ResourceTypeConverter can now build Resource objects which
    have been uploaded before.

Change-Id: Ibc6970524967d18fdab84639f7d53ddcf8c27c00
Related: #26667
Resolves: #25966
Resolves: #26886

History

#1 Updated by Karsten Dambekalns over 4 years ago

  • Category set to Resource
  • Target version set to 1.0 beta 1

#2 Updated by Karsten Dambekalns over 4 years ago

  • Status changed from New to Accepted
  • Assigned To set to Karsten Dambekalns

#3 Updated by Karsten Dambekalns over 4 years ago

  • Category changed from Resource to Persistence

#4 Updated by Sebastian Kurfuerst about 4 years ago

  • Status changed from Accepted to Under Review
  • Assigned To changed from Karsten Dambekalns to Sebastian Kurfuerst
  • % Done changed from 0 to 100

#5 Updated by Mr. Hudson about 4 years ago

Patch set 2 of change Ibc6970524967d18fdab84639f7d53ddcf8c27c00 has been pushed to the review server.
It is available at http://review.typo3.org/2222

#6 Updated by Bastian Waidelich about 4 years ago

Note: I think, the correct approach is, to always resend the uploaded file (e.g. it's resource pointer hash) on submit even if it was not changed. Just like other form fields.
This way you can reset the value to an empty string on order to remove an uploaded resource. Needs to be discussed though.

#7 Updated by Sebastian Kurfuerst about 4 years ago

  • Status changed from Under Review to Resolved

Also available in: Atom PDF