diff --git a/app/controllers/application.rb b/app/controllers/application.rb index 4898f23c..6058e699 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -107,16 +107,16 @@ class ApplicationController < ActionController::Base end def rescue_action_in_public(exception) - render_text <<-EOL - - -

There was a controller specific error processing your request.

- - - + message = <<-EOL + +

Internal Error 500

+

An application error occurred while processing your request.

+ + EOL + render_text message, 'Internal Error 500' end - + def return_to_last_remembered # Forget the redirect location redirect_target, @session[:return_to] = @session[:return_to], nil diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb index bec7b0b9..ee8c63a6 100644 --- a/app/controllers/wiki_controller.rb +++ b/app/controllers/wiki_controller.rb @@ -190,10 +190,10 @@ class WikiController < ApplicationController ) end redirect_to_page @page_name - rescue Instiki::ValidationError => e + rescue => e page.unlock if defined? page flash[:error] = e - return_to_last_remembered + redirect_to :action => 'edit', :web => @web_name, :id => @page_name end end @@ -207,7 +207,7 @@ class WikiController < ApplicationController logger.error e flash[:error] = e.message if in_a_web? - redirect_to :web => @web_name, :action => 'edit', :id => @page_name + redirect_to :action => 'edit', :web => @web_name, :id => @page_name else raise e end diff --git a/test/functional/wiki_controller_test.rb b/test/functional/wiki_controller_test.rb index 9b0cafdc..d5420154 100755 --- a/test/functional/wiki_controller_test.rb +++ b/test/functional/wiki_controller_test.rb @@ -556,7 +556,7 @@ class WikiControllerTest < Test::Unit::TestCase 'content' => @home.revisions.last.content.dup, 'author' => 'SomeOtherAuthor'}, {:return_to => '/wiki1/show/HomePage'} - assert_redirect_url '/wiki1/show/HomePage' + assert_redirected_to :action => 'edit', :web => 'wiki1', :id => 'HomePage' assert_flash_has :error assert r.flash[:error].kind_of?(Instiki::ValidationError)