Skip to content

Commit

Permalink
Load site default language ID into session unless the one in session …
Browse files Browse the repository at this point in the history
…is associated with the current site.
  • Loading branch information
dbwinger authored Jul 1, 2024
1 parent 72973ad commit 5df0ed8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/controllers/concerns/alchemy/admin/current_language.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ module CurrentLanguage

def load_current_language
@current_language = if session[:alchemy_language_id].present?
set_alchemy_language(session[:alchemy_language_id])
if current_alchemy_site.languages.where(id: session[:alchemy_language_id]).exists?
set_alchemy_language(session[:alchemy_language_id])
else
current_alchemy_site.default_language

Check warning on line 19 in app/controllers/concerns/alchemy/admin/current_language.rb

View check run for this annotation

Codecov / codecov/patch

app/controllers/concerns/alchemy/admin/current_language.rb#L19

Added line #L19 was not covered by tests
end
else
Current.language
end
Expand Down

0 comments on commit 5df0ed8

Please sign in to comment.