Bug #65863

content_fallback / mergeIfNotblank fails with content slide, pageOverlayFields is ignored

Added by Sigfried Arnold 5 months ago. Updated 15 days ago.

Status:Under Review Start date:2015-03-20
Priority:Must have Due date:
Assigned To:- % Done:

0%

Category:- Spent time: -
Target version:-
TYPO3 Version:6.2 Is Regression:No
PHP Version: Sprint Focus:
Complexity:

Description

I try to output every image referenced in page.media - if a page is translated and there are no images present in "media" i'd expect it to grab the content from the default language. This works perfectly fine for any other field and worked perfectly fine in TYPO3 4.5 LTS but seems to be broken in 6.2 LTS

Those 2 solutions put me closest to what i want to achieve.

Steps to reproduce:
1) put $GLOBALS['TCA']['pages_language_overlay']['columns']['media']['l10n_mode'] = 'mergeIfNotBlank'; in your extTables.php
2) Create a page (a) with some Images in media
3) Create a translation of this page without setting any images
4) Create a subpage (b) of this page without images
5) Create a translation of this subpage without any images
6) output the image

MEDIA = FILES
MEDIA {
    references {
        table = pages
        uid.data = leveluid:-1, slide
        fieldName = media
    }
    begin = 0
    renderObj = COA
    renderObj {
        10 = IMAGE
        10 {
            file {
                import.data = file:current:uid
                treatIdAsReference = 1
            }
        }
    }
}

6) Request Page b in default and translation

This works fine as expected, both show the images form page a

7) add an image to page b without translating it

The image is not on page b either in default nor in translation

8)

Replace the code with this one (this is the solution provided in the wiki http://wiki.typo3.org/File_Abstraction_Layer#How_to_use_.22levelmedia.22_with_6.x_.3F)

MEDIA = FILES
MEDIA {
    references {
        data = levelmedia:-1, slide
    }
    ...
}

Now on both pages a and b the images are shown in default language but in the translation they are not shown on either page.


Related issues

related to Core - Bug #19718: Typoscript: CONTENT | slide: multilanguage not correctly... Accepted 2008-12-18
related to Core - Bug #48113: typoscript FILES object always uses default language when... Resolved 2013-05-11
related to Core - Bug #58352: Invalid localization overlay of cObject FILES Resolved 2014-04-30

History

#1 Updated by Sigfried Arnold 5 months ago

Forgot to mention - is is also reproduceable with a custom extension which extends the pages and pages_language_overlay tables

#2 Updated by Christian von Holten 5 months ago

Same for me. Settings in localconf is:

'pageOverlayFields' => 'uid,title,subtitle,nav_title,keywords,description,abstract,author,author_email,url,urltype,shortcut,shortcut_mode',

It is without media.

Translated Pages should get image from default language by this code:

10 = IMAGE
10 {
wrap = |
required = 1
file {
import = uploads/media/
import.field = media
import.listNum = 0
treatIdAsReference = 1
width = 275c
height = 160c
ext = jpg
}

In TYPO3 6.2.3 it worked. But now, in TYPO3 6.2.11 no image is shown in translated pages

#3 Updated by Markus Klein 5 months ago

We just merged a patch in 6.2 that might be related. Can you please check, if this solves the problem for you?
https://review.typo3.org/37940/

#4 Updated by Christian von Holten 5 months ago

The patch does not make any difference to me

#5 Updated by Markus Klein 5 months ago

I tried to reproduce this on current master.
I used the TS from 8) and everything works like expected. The image assigned to page A (default lang) is shown on all page and language combinations.

So it seems to be an issue on 6.2 only. Didn't verify things there yet.

#6 Updated by Sigfried Arnold 5 months ago

i'm not at work anymore so i can't verify this at the moment, but i'm pretty sure this worked already - so i assume Christian van Holten could be right, that this worked in 6.2.3 and is now broken

i'll test this on monday to check if there is any difference with different versions of 6.2

also as i mentionend "pageOverlayFields" seems to be ignored in LocalConfiguration.php - if you empty it completely it makes no difference and the overlay for all other fields will still work - as far as i understand the related code, not all of the default configuration is overwritten by LocalConfiguration.php - but by an AdditionalConfiguration.php - this is pretty wierd and intransparent and does not seem to work in this case either - if some values are removed form the default file in the core, the override stops working - but in either case, there is no effect if you remove "media" or not (which was the solution we used in TYPO3 4.5)

#7 Updated by Sigfried Arnold 4 months ago

i've no isolated the problem - i checked this 6.2.10, 6.2.11 and 6.2.3 - i have not checked other versions

media is present in pageOverlayFields
l10n_mode is set to mergeIfNotBlank
references are collected with data = levelmedia:-1, slide

same as before, page a and b where a is translated with images and b is not

if you request page b in translation you get the image set in the translation of page a and not the image in the default language of page b

it seems the slide is done before the overlay - if you remove media from overlay fields it is not overlayed, but the slide works as expected

with the same code (without references/fal) this worked in 4.5

this is not a big issue with smaller sites with a few translations, but if you have a huge site with lots of translations, this is really PITA for the editor


Edit: i've found an old issue, which did in principle the same with tt_content records #19718

#8 Updated by Christoph Lehmann 25 days ago

Overlaying the media field in 6.2.14 works!

I used

$GLOBALS['TCA']['pages_language_overlay']['columns']['media']['l10n_mode'] = 'mergeIfNotBlank';

AND

page = PAGE
page.10 = FILES
page.10 {
    references {
        table = pages
        uid.data = leveluid:-1, slide
        fieldName = media
    }
    begin = 0
    renderObj = COA
    renderObj {
        10 = IMAGE
        10 {
            file {
                import.data = file:current:uid
                treatIdAsReference = 1
            }
        }
    }
}

#9 Updated by Andreas Allacher 18 days ago

Using levelmedia, however, still doesn't work but at least the code above works

#10 Updated by Markus Klein 16 days ago

@Andreas: Can you fix that?

#11 Updated by Andreas Allacher 15 days ago

Will try to look into it as I need it anyway.
If I am able to fix it, I will post a patch.
Otherwise I will let you know.

Also leveluid doesn't do the same as levelmedia because it only slides until it finds an uid which should be pretty soon :)

Sorry for response delay but I forgot to add ticket to watch list.

#12 Updated by Gerrit Code Review 15 days ago

  • Status changed from New to Under Review

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/41720

#13 Updated by Gerrit Code Review 15 days ago

Patch set 2 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/41720

Also available in: Atom PDF