From 16454549fee5eb0fc827e825ce392877b118cda4 Mon Sep 17 00:00:00 2001 From: Alexey Verkhovsky Date: Tue, 27 Sep 2005 03:30:01 +0000 Subject: [PATCH] Fixed a nasty bug that caused Instiki to go into an endless loop on call to /wiki/print/ --- app/controllers/revision_sweeper.rb | 4 ++++ app/controllers/wiki_controller.rb | 3 +++ 2 files changed, 7 insertions(+) diff --git a/app/controllers/revision_sweeper.rb b/app/controllers/revision_sweeper.rb index 1ab4676b..879274e3 100644 --- a/app/controllers/revision_sweeper.rb +++ b/app/controllers/revision_sweeper.rb @@ -23,5 +23,9 @@ class RevisionSweeper < ActionController::Caching::Sweeper :action => %w(authors recently_revised list) expire_fragment :controller => 'wiki', :web => web.address, :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 diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb index fdd83d21..787f8c6a 100644 --- a/app/controllers/wiki_controller.rb +++ b/app/controllers/wiki_controller.rb @@ -156,6 +156,9 @@ class WikiController < ApplicationController end def print + if @page.nil? + redirect_home + end @link_mode ||= :show @renderer = PageRenderer.new(@page.revisions.last) # to template