Skip to content

Commit

Permalink
fixes Issue #81 - render_elements method finds a Page regardless of t…
Browse files Browse the repository at this point in the history
…he language when using fallback option
  • Loading branch information
robinboening committed Oct 30, 2011
1 parent 2d5e80f commit a04df11
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/helpers/elements_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def render_elements(options = {})
element_string = ""
if options[:fallback]
unless all_elements.detect { |e| e.name == options[:fallback][:for] }
if from = Page.find_by_page_layout(options[:fallback][:from])
if from = Page.find_by_page_layout_and_language_id(options[:fallback][:from], session[:language_id])
all_elements += from.elements.find_all_by_name(options[:fallback][:with].blank? ? options[:fallback][:for] : options[:fallback][:with])
end
end
Expand Down

1 comment on commit a04df11

@tvdeyen
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please write a Test?
Thank you

Please sign in to comment.