Fixed a nasty bug that caused Instiki to go into an endless loop on call to /wiki/print/

This commit is contained in:
Alexey Verkhovsky 2005-09-27 03:30:01 +00:00
parent 1d44ce1c18
commit 16454549fe
2 changed files with 7 additions and 0 deletions

View file

@ -23,5 +23,9 @@ class RevisionSweeper < ActionController::Caching::Sweeper
:action => %w(authors recently_revised list) :action => %w(authors recently_revised list)
expire_fragment :controller => 'wiki', :web => web.address, expire_fragment :controller => 'wiki', :web => web.address,
:action => %w(rss_with_headlines rss_with_content) :action => %w(rss_with_headlines rss_with_content)
WikiReference.pages_that_reference(page.name).each do |ref|
expire_action :controller => 'wiki', :web => web.address,
:action => %w(show published), :id => ref.page.name
end
end end
end end

View file

@ -156,6 +156,9 @@ class WikiController < ApplicationController
end end
def print def print
if @page.nil?
redirect_home
end
@link_mode ||= :show @link_mode ||= :show
@renderer = PageRenderer.new(@page.revisions.last) @renderer = PageRenderer.new(@page.revisions.last)
# to template # to template