From d5a28204ac8cce6d7fa5b803475f95b7c0eccc40 Mon Sep 17 00:00:00 2001 From: jwollert Date: Fri, 29 Apr 2011 17:17:37 +0200 Subject: [PATCH] Settings should not be cached due to changing permissions and query states --- lib/widget/controls/delete.rb | 2 ++ lib/widget/controls/save.rb | 2 ++ lib/widget/controls/save_as.rb | 2 ++ 3 files changed, 6 insertions(+) diff --git a/lib/widget/controls/delete.rb b/lib/widget/controls/delete.rb index b26f3fc3e5..a06951aad3 100644 --- a/lib/widget/controls/delete.rb +++ b/lib/widget/controls/delete.rb @@ -1,4 +1,6 @@ class Widget::Controls::Delete < Widget::Base + dont_cache! + def render return "" if @query.new_record? or !@options[:can_delete] button = link_to content_tag(:span, content_tag(:em, l(:button_delete), :class => "button-icon icon-delete")), "#", diff --git a/lib/widget/controls/save.rb b/lib/widget/controls/save.rb index 3f54451805..b41a75c1b0 100644 --- a/lib/widget/controls/save.rb +++ b/lib/widget/controls/save.rb @@ -1,4 +1,6 @@ class Widget::Controls::Save < Widget::Base + dont_cache! + def render return "" if @query.new_record? or !@options[:can_save] write link_to content_tag(:span, content_tag(:em, l(:button_save)), :class => "button-icon icon-save"), {}, diff --git a/lib/widget/controls/save_as.rb b/lib/widget/controls/save_as.rb index 25e3c46616..c6784bb1d8 100644 --- a/lib/widget/controls/save_as.rb +++ b/lib/widget/controls/save_as.rb @@ -1,4 +1,6 @@ class Widget::Controls::SaveAs < Widget::Base + dont_cache! + def render if @query.new_record? link_name = l(:button_save)