When run scheduler manually then everything works fine and it fetches all fallback items too but when it automatically triggers from scheduler then language fallback items are not coming. What can be the cause and how to fix it?
1 Answer
Cause :
When manually runs the task then context site is core but when it runs through scheduler then context site is scheduler. By default languagefalllback is false for it.
Resolution: You need to provide a patch to allow language fallback on scheduler site too. For this just add below patch in your details config.
<site name="scheduler" >
<patch:attribute name="enableItemLanguageFallback">true</patch:attribute>
<patch:attribute name="enableFieldLanguageFallback">true</patch:attribute>
</site>
Now it will retrieve fallback item as well.
It will impact all of your scheduler task, but if you want to restrict it to a particular activity then assign context site using code . Then it will be applicable to only that piece of execution.