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.
We have four indexes for each of four languages on our site. Panelized content always gets indexed in the default language because entity languages don't get passed down through the panels/panelizer rendering stack.
The only solution I could find was to override the language_content global during the rendering of the page_manager entity.
See attached patch.
Comment | File | Size | Author |
---|---|---|---|
#5 | panelizer-search_api_language-2757995-5.patch | 1.65 KB | clairedesbois@gmail.com |
| |||
#2 | panelizer-search_api_language-2757995.patch | 1.65 KB | mathieuhelie |
|
Comments
Comment #2
mathieuhelie CreditAttribution: mathieuhelie at Floe design + technologies for Medidata commentedThis issue is related to #2757229: When rendering a panelized entity in one of its non-default languages, fieldable panel panes are rendered in the $GLOBALS language..
Comment #3
dsnopekThanks! This makes senses to me
I have one bit of code review, however:
This should be done outside of the try/catch block so that the global language is stored even when an exception in thrown. In fact, I'd move all of the language manipulation stuff to be outside of the try/catch block, and just leave the rendering inside.
Comment #4
DamienMcKennaAgreed with what dsnopek said, also the if() statements need a space after the "if" word to match the Drupal coding standards.
Comment #5
clairedesbois@gmail.comI modified the patch to do the corrections
Comment #6
clairedesbois@gmail.comComment #7
dsnopekThanks! I haven't tested this, but the code looks good to me.
Comment #9
DamienMcKennaThanks for the improvements, I've committed this.