Bug #37230

Image TypeConverter does not allow to map Image by Identity

Added by Carsten Bleicker about 1 year ago. Updated 7 months ago.

Status:Resolved Start date:2012-05-16
Priority:Should have Due date:
Assignee:Adrian Föder % Done:

0%

Category:-
Target version:-
Votes: 1 (View)

Description

I want to remove an Image Entity from another Entity by its Identity.
So i used <f:link.action action="remove" arguments={section:section,image:image}> ...
The resulting URI looks like this: &section[__identity]=29870197-33ca-43c7-9649-70c3c0f28004&image[__identity]=51e35272-e273-4aa3-8f3f-bdd0932edb23

controller action just has these mapping infos: **
  • Remove Image from a given Section
  • @param \My\Name\Domain\Model\Section $section
  • @param \TYPO3\Media\Domain\Model\Image $image
  • @return void
    */
    public function removeImageAction(\My\Name\Domain\Model\Section $section, \TYPO3\Media\Domain\Model\Image $image){
    $section->removeImage($image);
    $this->persistenceManager->update($section);
    $this->redirect('show',NULL,NULL,array('section'=>$section));
    }

But the mapping throws the following exception for this removeImageAction:
#1297759968: Exception while property mapping for target type "TYPO3\Media\Domain\Model\Image", at property path "": It is not allowed to map property "__identity". You need to use $propertyMappingConfiguration->allowProperties('__identity') to enable mapping of this property. (More information)

Just for testing i disabled the mathing of the ImageConverter from $targetType = 'TYPO3\Media\Domain\Model\Image';
to $targetType = 'TYPO3\Media\Domain\Model\ImageFoo';

And the mapping works again.
Can somebody explain me the need of this ImageConverter?

Kind regards
Carsten


Related issues

related to TYPO3.Media - Bug #42749: Broken ImageConverter for PHP 5.3 Resolved 2012-11-07

Associated revisions

Revision 27d2c527
Added by Adrian Föder 7 months ago

[BUGFIX] Fix Image TypeConverter

The Image TypeConverter now takes care about a given `title` property
and takes it into account for the mapping; additionally the handling of
mapping persisted Images (i.e. sources with an ``__identity`` property)
works as it used to be for persisted entities.

This is covered by some additional Functional Tests, which have,
besides, been augmented a bit and refactored to an abstract functional
test case for reusable methods.

Change-Id: I83e0953278b0dac42b151b2859606206d7f1cf8f
Fixes: #36959
Fixes: #37230

History

Updated by Adrian Föder 11 months ago

  • Status changed from New to Needs Feedback
  • Priority changed from -- undefined -- to Should have

Carsten, is this still recent?

Updated by Carsten Bleicker 11 months ago

Adrian Föder wrote:

Carsten, is this still recent?

ehm, i don't know :)
stopped working on it since 1 month because of daily business :(
sorry

Updated by Dominique Feyer 9 months ago

Any update on this issue ?

Updated by Adrian Föder 7 months ago

  • Status changed from Needs Feedback to Resolved

Updated by Karsten Dambekalns 7 months ago

  • Assignee set to Adrian Föder

Also available in: Atom PDF