[BUGFIX] Reset legacy fields if no relations are found 48/17848/2
authorHelmut Hummel <h.hummel@bitmotion.de>
Wed, 30 Jan 2013 16:39:28 +0000 (17:39 +0100)
committerJigal van Hemert <jigal@xs4all.nl>
Wed, 30 Jan 2013 17:28:12 +0000 (18:28 +0100)
commitf5674cb505802de17248d8a522b292e5f515d00a
treefa52efddb030c4e49bb5013f0d6b133b8558ac4a
parente67bb7989e1b358b8debb25ed644cd9f81abed83
[BUGFIX] Reset legacy fields if no relations are found

If you add multiple images to a tt_content element
but mark all of them hidden, an image is shown which has
the uid of the number of images added to the element.

This is the case because TYPO3 puts the relation count in the
field and the frontend adapter service does not reset
the field if no relations are found.

The solution is to set the legacy fields in any case.

This change adds a test which fails without a fix
and another test which shows that the original behaviour
is not affected.

Resolves: #44988
Releases: 6.0, 6.1

Change-Id: Ia4690fb0a68cd4d6832aef6712bc69adf00f8a5f
Reviewed-on: https://review.typo3.org/17848
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
typo3/sysext/core/Classes/Resource/Service/FrontendContentAdapterService.php
typo3/sysext/core/Tests/Unit/Resource/Service/FrontendContentAdapterServiceTest.php [new file with mode: 0644]