[BUGFIX] Reset legacy fields if no relations are found 71/17871/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 18:32:30 +0000 (19:32 +0100)
commit6d1402932b027837518e35693b1e835cd413de3b
treeaf9926e84de86a423bbd380b25ec79b4b69817e4
parent4743e1c93ab9f0b2e6aacf3ef351dfa5bbf703aa
[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.

Change-Id: I2cacfe185e1371331ab7564413e43c7d6cce8556
Resolves: #44988
Releases: 6.0, 6.1
Reviewed-on: https://review.typo3.org/17871
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]