-
-
Notifications
You must be signed in to change notification settings - Fork 317
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
Exception raised when boolean ingredient is used for element preview text #2329
Comments
Hey. Could it be that the translation of the essence boolean is not a String, but cast to a Boolean instead? alchemy_cms/app/models/alchemy/ingredients/boolean.rb Lines 16 to 18 in 025e011
|
Good point, that's the issue indeed. The It means it currently works in english, but not in any other language. |
Ok. This is an issue of |
This issue has not seen any activity in a long time. |
Maybe we cast the |
If the translation is missing I18n returns a boolean instead of a string. Cast to string unless the value is nil. Closes AlchemyCMS#2329
@robinboening fixed by #2367 |
If the translation is missing I18n returns a boolean instead of a string. Cast to string unless the value is nil. Closes #2329
If the translation is missing I18n returns a boolean instead of a string. Cast to string unless the value is nil. Closes AlchemyCMS#2329
Steps to reproduce
Expected behavior
In the elements list, the element's header part should render "true".
Actual behavior
Error is raised: Exception: undefined method `empty?' for true:TrueClass
The error is raised inside the
sanitize
helper astrue
is passed and boolean type can not be handled.See https://github.com/AlchemyCMS/alchemy_cms/blob/main/app/views/alchemy/admin/elements/_header.html.erb#L18
A quick fix is to always cast the value to string when passing it to
sanitize
.System configuration
The text was updated successfully, but these errors were encountered: