Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Collection custom filter messing with localized content - in() function side effect? #1539
I'm using a custom filter to prevent some content from being shown dependent on some custom logic.
The filter seems to work fine but it messes with the localization of content.
For instance this basic filter works and shows my content according to the current locale.
But with this one:
the filter still works but the content shows in Portuguese, even though I have only read a variable. It seems that the in() function has some kind of side effect.
This doesn't seem to be the expected behaviour. Is there any other function like in() but without the side effect?
By the way, I can work around this by copying the object.
but it still seems that the in() function shouldn't have this kind of side effect.
I'm guessing there's more to your code than the snippet you posted.
You're just setting the
Can you provide your actual code? If you're using
Hi. Thank you for your help.
Of course that's not all the code.
That's why I'm assuming that the
Here's the code:
This is the version I currently have in production to fix that issue. It works perfectly fine by just copying the
Questions are OK :)
As soon as I run:
the content changes language.
Actually I believe that it is the combination between