fix cached widgets

pull/6827/head
Konstantin Haase 13 years ago
parent 7d53dd1f36
commit bfa8869f72
  1. 2
      lib/widget/base.rb
  2. 3
      lib/widget/table.rb

@ -13,7 +13,7 @@ class Widget::Base < Widget
##
# Query whether this widget class should be cached.
def self.dont_cache?
@dont_cache || self == Widget::Base || Widget::Base.dont_cache?
@dont_cache or self == Widget::Base && Widget::Base.dont_cache?
end
def initialize(query)

@ -101,7 +101,8 @@ class Widget::Table < Widget::Base
if @subject.result.count <= 0
write(content_tag(:p, l(:label_no_data), :class => "nodata"))
else
render_widget(resolve_table, @subject, @options.reverse_merge(:to => @output))
str = render_widget(resolve_table, @subject, @options.reverse_merge(:to => @output))
@cache_output.write(str.html_safe) if @cache_output
end
end
end

Loading…
Cancel
Save