-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ContentCulturePicker still not working with liquid templates (since v1.8.0) #16670
Comments
We triaged this issue and set the milestone according to the priority we think is appropriate (see the docs on how we triage and prioritize issues). This indicates when the core team may start working on it. However, if you'd like to contribute, we'd warmly welcome you to do that anytime. See our guide on contributions here. |
This PR is the one adding A simple mitigation would be to just add services.Configure<TemplateOptions>(o =>
{
o.MemberAccessStrategy.Register<CultureInfo>();
}) in one of your Startup classes. In parallel we need to see why you are getting this exception when re-defining the shape template in liquid. To my knowledge this has been a recommended way of customization this shape so this should work. Maybe this works in 2.0 (if you can try the main branch). |
Regarding your suggested mitigation, I've modified the
However, this seems to have no effect in the |
That could only possible if something else is add options.MemberAccessStrategy.Register<CultureInfo>("Name", "EnglishName", "NativeName"); |
No luck with that syntax either. Same results: Empty strings. Only However, using our tweak described above (embedding the content language picker within the "Layout.liquid" itself) and using translations, we've managed to mimick the original behaviour. So, we are now using:
We had to edit the files We can live with it for the moment, hoping the issue will be fixed in v2.x. Can you confirm this? And also... is there any expected/approximate date for that? Thanks. |
@MikeAlhayek could you please look into this while you are the last one working in the |
This is my solution, it works well for me with the orchardCore 2.0.0. I have added it in the Layout.liquid template file.
Hope it can help you. :) |
Describe the bug
Since the release 1.8.0, OC is not able to render ContentCulturePicker using liquid templates (a RuntimeBinderException is thrown)
Orchard Core version
We try to update our installation every new version is released. Now we have tried with v1.8.4 but the issue still persists. We are forced to stay with v1.7.2 (which is the last one that works fine with ContentCulturePicker and our liquid templates).
To Reproduce
Expected behavior
A dropdown with the available languages should be rendered (along with the rest of the page)
![image](https://private-user-images.githubusercontent.com/6704109/364697668-92a857e7-8328-441a-952f-8add4091dd24.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk4NzczNjAsIm5iZiI6MTczOTg3NzA2MCwicGF0aCI6Ii82NzA0MTA5LzM2NDY5NzY2OC05MmE4NTdlNy04MzI4LTQ0MWEtOTUyZi04YWRkNDA5MWRkMjQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMThUMTExMTAwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MzRjOWI5NjUwN2IwZmJhYWQzNDVkOTU4N2FlODNjNTExN2U0YWM0OTEzZGJjZjVmODdiNzRiMTM4MjZlN2JiZiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.orFU_QGcbLUB3IosuxbJSnhbZxCw7vC6EMQTlHJzTPo)
Additional info
We've had this issue for quite a long time and because of that we've been monitoring the some of the project related issues, such as:
We have tested and tweaked both our "ContentCulturePickerContainer.liquid" and "Layout.liquid" with every comment and suggestion from those threads, with no luck. None of them work: either no localization menu appears or an exception is thrown.
The best thing we have been able to get has been by getting rid of the "ContentCulturePickerContainer.liquid" completely and embed the following code within the "Layout.liquid" itself:
With this tweak, we can render a simple language menu, as this:
![image](https://private-user-images.githubusercontent.com/6704109/364715400-fc530919-af6d-4c16-91d0-e18ee11e6b4f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk4NzczNjAsIm5iZiI6MTczOTg3NzA2MCwicGF0aCI6Ii82NzA0MTA5LzM2NDcxNTQwMC1mYzUzMDkxOS1hZjZkLTRjMTYtOTFkMC1lMThlZTExZTZiNGYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMThUMTExMTAwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NzlkY2VhNzcxNmUyZDM4NTQzYTk3M2VhNDAzZjllMjdkYzNjYzBiOWRhNDZlMzEwYjQyZTcyY2ExODAxNzJmYiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.LIURSKJFk-enOQgeQmU09WQhVzCmOhF8-P6ooBQBt40)
This is not as good as the original because the object
Culture
only seems to have aName
property. Any attempt to useDisplayName
,EnglishName
,NativeName
,etc, they all yield an empty string.Logs and screenshots
Full "Raw exception details" are as follow:
The text was updated successfully, but these errors were encountered: