I have a website with SXA (1.7.1) and language fallback setup up. It all works fine for regular components (eg. carousel or a custom component made by us) but lists (eg. Link List) won't pick up fallback items.
So the problem is as follows:
- There is a Link List component on the page
- There is datasource with list of links in the Data section
- The datasource and the links all have only english version
- I am opening the page in
de-delanguage and I can't see any of the links (the component itself is visible - I can see div.component.link-list in the source)
- The problem above does not happen on carousel for example (so I have slides in English and see them all in German version).
I had a similar issue in SXA 1.2 and I digged into
LinkListRepository which inherits from
ListRepository where there is a
GetItem() method. This method uses extension method
ItemExtensions class. I think this might cause the problem with language fallback - the items are just not returned if there is no version. Moreover in the extension method there is a following piece of code used:
and the items are visible in edit mode.
The questions from my side:
- Is this correct behavior of a bug?
- Is there any hidden mechanism to enable language fallback on list components?
- If not, how can I override
LinkListRepositoryto fix this problem? I cannot find it registered in the the
<services>section so I could replace it with my own implementation? I have a custom Link List component and custom repository registered but apparently it gets overriden by original
LinkListRepositorybeing registered later on. This method worked in SXA 1.2.
I have managed to workaround this problem by moving my configurator class which creates an instance of
ILinkListRepository to the end of the
Which leaves me with question: Where on earth are you instantiating your class? Plus confirm please if this is expected or a bug.