Bug #46067

Image rendering fails when using 'image' or 'media' field with own CEs (CType)

Added by Tilo Baller over 6 years ago. Updated 12 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2013-03-06
Due date:
% Done:

100%

TYPO3 Version:
6.0
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

The Bugfix #45415 breaks image rendering for custom content elements which reuse the fields 'image' or 'media' for own storage of media references.

We use custom content elements similiar to this definition:

$TCA['tt_content']['types']['tx_abc_ce_teaser'] = array('showitem' => 'header,image,tx_abc_ce_customfield1,tx_abc_ce_customfield2,tx_abc_ce_customfieldn');

It could be fixed by extending the $migrateFields variable defined in FrontendContentAdapterService:39:

    static protected $migrateFields = array(
        'tt_content' => array(
            'image' => array(
                'paths' => 'image',
                'titleTexts' => 'titleText',
                'captions' => 'imagecaption',
                'links' => 'image_link',
                'alternativeTexts' => 'altText',
                '__typeMatch' => array(
                    'typeField' => 'CType',
                    'types' => array('image', 'textpic'),
                )
            ),
            [...]
        ),
        [...]
    );

May be it can be moved to DefaultConfiguration so we can extend it like that:

$GLOBALS['TYPO3_CONF_VARS'['FE']['migrateFields']['tt_content']['image']['typeMatch']['types'][] = 'tx_abc_ce_teaser';


Related issues

Related to TYPO3 Core - Bug #45415: Content adapter sets imagecaption of media field instead of image field Closed 2013-02-12
Related to TYPO3 Core - Bug #46090: Contentobject data Image/Link broken or missing Closed 2013-03-07

Associated revisions

Revision 99ddf6dc (diff)
Added by Alexander Stehlik over 5 years ago

[BUGFIX] Manipulation of file field migration config

This patch introduces new methods to the FrontendContentAdapterServer
that allow the manipulation of the file field migration configuration.
It is now possible to add additional (content) types for which the
migration should be active and to add custom migration configurations.

Releases: 6.2
Resolves: #46067
Documentation: #56365
Change-Id: Ibc23be8a414192c8795d9bb4f09316cf608e240b
Reviewed-on: https://review.typo3.org/23360
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Tested-by: Tom Peters
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind

History

#1 Updated by Stefan Galinski over 6 years ago

Sounds like you already discovered a solution. Can you please provide a patch and push it to our review system on http://review.typo3.org. You will find some guidance in the TYPO3 wiki: http://wiki.typo3.org/Contribution_Walkthrough_Tutorials.

#2 Updated by Tobias Wollender over 6 years ago

Hi,

I created a simple test extension with a teaser element.
https://github.com/tliegl/contentelements

Install the extension, create a teaser element and add an image.

In the <f:debug> output you can see, that all information for images are empty (imagecaption, altText, titleText, image_link) and "image" just contains the count of images in the element.

If you add the CType of the element (contentelements_teaser) to the array in typo3/sysext/core/Classes/Resource/Service/FrontendContentAdapterService.php all fields get filled again.

'types' => array('image', 'textpic', 'contentelements_teaser'),

I hope this helps! :)

Thanks,
Tobi

#3 Updated by Christian Bernet over 6 years ago

With 6.0.5 for us this bug is fixed.
thanks, christian

#4 Updated by Robert Böing over 6 years ago

How did you fix it. What I need to do, to configure my own extension?

#5 Updated by Tobias Wollender over 6 years ago

In my extension I solved it with an own fal viewhelper now. You can see the solution in this little extension: https://github.com/tliegl/contentelements

#6 Updated by Gerrit Code Review about 6 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/23360

#7 Updated by Gerrit Code Review almost 6 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/23360

#8 Updated by Gerrit Code Review over 5 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/23360

#9 Updated by Alexander Stehlik over 5 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#10 Updated by Benni Mack 12 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF