Skip to content
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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pages/app/views/refinery/admin/pages/_page.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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| %>
Copy link
Member

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 ?

Copy link
Contributor Author

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.

Copy link
Member

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.

<% if translation.title.present? %>
<%= link_to refinery.admin_edit_page_path(page.nested_url, switch_locale: translation.locale),
class: 'locale', title: translation.locale.upcase do %>
Expand Down