Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When viewing a panelized node with paragraphs fields in, the default language is always shown, instead of the language for which it's been translated. To reproduce do the following:
- Create multiple languages on the site
- Create a content type with a paragraphs field
- Make the paragraph fields translatable (fields on the paragraph, not the field on the content type)
- Create new content with multiple translations, verify that this works
- Panelize the view mode, and view different translations, note that default language is shown for all translations.
Comments
Comment #2
TomSaw CreditAttribution: TomSaw commentedSame behavior for me!
Comment #3
japerryThis appears to be related to #2461695: Support asymmetric translations -- when I have patch #143 applied, turn on paragraphs translations, and turn off paragraphs being translatable themselves, it works.
Comment #4
japerrySo my last comment doesn't really work. Creating different paragraphs can work in certain use cases, but it means that paragraphs themselves aren't translatable so you cannot send them to smartling, lingotek, etc.
If you're doing simple drupal translations, the patch suggested in #3 works. But there is something wrong between panelizer and paragraphs that is causing paragraphs to render their original language rather than the translated one.
Comment #5
DamienMcKennaLets put some tests together to confirm it works as intended.
Comment #6
CulacovPavel CreditAttribution: CulacovPavel commentedConfirm issue.
Comment #7
abu-zakham CreditAttribution: abu-zakham at Vardot commentedI can confirm this issue.
Comment #8
sgurlt CreditAttribution: sgurlt as a volunteer and at Bright Solutions GmbH commentedI also can confirm that issue. I tried: https://www.drupal.org/node/2461695#comment-12018370 But without any luck.
Comment #9
AndrewsizZ CreditAttribution: AndrewsizZ at Bright Solutions GmbH for Bright Solutions GmbH commentedconfirm
Comment #10
AndrewsizZ CreditAttribution: AndrewsizZ at Bright Solutions GmbH for Bright Solutions GmbH commentedseems like problem not only for paragraphs, problem for all entity reference fields
1. create entity reference field
2. create entity for reference and translate this entity
3. add this entity to reference field to node.
4. enable panelizer for this node
you will see that referenced entity on node view will be always in default language, even if you switch language, but if you disable panelizer all works correct on default node view page.
After debug seems like panelizer using viewField in EntityViewBuilder but default node view page using buildComponents in EntityViewBuilder. And issue seems like somewhere between.
Comment #11
ziomizar CreditAttribution: ziomizar as a volunteer and at Station, East Atlantic Engineering commentedThe problems seems that paragraph fields into the host can't be translated.
The default language of fields that reference to a paragraph is always the default one as the field itself is not translatable.
Other fields works properly, but with paragraphs i have this problem too.
Comment #12
TipiT CreditAttribution: TipiT as a volunteer and at TIP Solutions commentedI confirm. I applied https://www.drupal.org/project/paragraphs/issues/2461695#comment-12293048 and tried different congigurations but it seems not to fix this Panelizer issue.
Comment #13
TipiT CreditAttribution: TipiT as a volunteer and at TIP Solutions commentedI confirm. I applied https://www.drupal.org/project/paragraphs/issues/2461695#comment-12293048 and tried different congigurations but it seems not to fix this Panelizer issue.
Comment #14
dimr CreditAttribution: dimr commentedUsing Drupal 8.4.4, Panelizer 8.x-4.0, Panels 8.x-4.2 and followed the documentation https://www.drupal.org/node/2735121 to configure my paragraph as symmetric translations, I can reproduce the same problem here described.
If I don't use Panelizer I can see the content in the selected language, but if I use panelizer then it shows always the default language and no the one of the page. That means that I have all the content that is not Paragraph in the correct language, the one selected in the page, and the paragraphs in the original language. And always I can see the correct language on the edit page of the content.
The issue https://www.drupal.org/project/paragraphs/issues/2461695#comment-12293048 is related to the asymmetric translations, that is another issue I think.
Comment #15
AndersNielsen CreditAttribution: AndersNielsen commentedI can confirm the issue.
Tried to do some debugging, and it seems to me it's not panelizer but instead the bug is comming from the ctools_block module.
If I add the same field as a normal (ctools)block outside the panelizer area, it will have the same behaviour. This beeing that it always shows the paragraphs in the default language, not the translated one.
Comment #16
dimr CreditAttribution: dimr at FIZ Karlsruhe commentedI was able to reproduce what @AndersNielsen described.
Then it is clear that this issue is not about Panelizer module, I have found this issue in the ctools module, but I am not sure if we are talking about the same problem.
https://www.drupal.org/project/ctools/issues/2700023
Has anyone clued if we are talking about the same?
Comment #17
dimr CreditAttribution: dimr at FIZ Karlsruhe commentedAfter making some test I have realized that the issue only appears using an "Entity Reference Revision" as the fields of "Paragraphs", but not using the fields "Entity Revisions".
Also, I have realized that creating a View Block showing that field "Entity Reference Revision" and adding that block in the Panelizer that will work too, it will be shown in the correct language.
I have created an issue in the module "Entity Reference Revision" for that.
Comment #18
Steven Buteneers CreditAttribution: Steven Buteneers commentedThis is related to a core issue with EntityViewBuilder::viewField()
See: https://www.drupal.org/project/drupal/issues/2955392. The patches in this issue fix the problem in this issue.
Comment #19
ziomizar CreditAttribution: ziomizar as a volunteer and at Station, East Atlantic Engineering commentedadded related issue reported by @Steven Buteneers
Comment #20
pburgh CreditAttribution: pburgh commentedWe've also run in to this issue. Running 8.6.4 with PHP 7.1.20, Paragraphs did not translate when used on a panelized node. Switching to PHP 5.x fixed the issue, but we're not interested in using PHP 5.x. The solution was to move to PHP 7.1.25 and then everything started working as designed. Hopefully this helps someone.