-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Fixed page listing error: comparison of Fixnum with nil failed #3308
base: main
Are you sure you want to change the base?
Conversation
When browsing at http://localhost:3000/refinery/pages Pages translated to locales not mentioned in the Refinery::I18n.frontend_locales causes: ``` ArgumentError in Refinery::Admin::Pages#index Showing .../refinerycms-pages-3.0.5/app/views/refinery/admin/pages/_page.html.erb where line refinery#28 raised: comparison of Fixnum with nil failed ``` This happens if you start translating into a language, but remove the locale from Refinery::I18n.frontend_locales if it is not ready at launch.
@@ -25,7 +25,7 @@ | |||
|
|||
<% if Refinery::I18n.frontend_locales.many? %> | |||
<span class='locales'> | |||
<% page.translations.sort_by{ |t| Refinery::I18n.frontend_locales.index(t.locale)}.each do |translation| %> | |||
<% page.translations.sort_by{ |t| Refinery::I18n.locales.index(t.locale)}.each do |translation| %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this change but we should really change the locale switcher the way we add the locales edit links. Perhaps we should create a presenter. Thoughts @parndt ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would also be nice if the webmaster could add and remove frontend languages, without requiring a deployment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if we want this, perhaps it's a good idea to ask a dev if we can add/remove a frontend language.
Is it possible to have a test case for this patch please? |
When browsing at http://localhost:3000/refinery/pages
Pages translated to locales not mentioned in the Refinery::I18n.frontend_locales causes:
This happens if you start translating into a language, but remove the locale from Refinery::I18n.frontend_locales if it is not ready at launch.