diff --git a/app/controllers/wiki_controller.rb b/app/controllers/wiki_controller.rb index afb60535..f7fb09e4 100644 --- a/app/controllers/wiki_controller.rb +++ b/app/controllers/wiki_controller.rb @@ -250,6 +250,7 @@ class WikiController < ApplicationController def rollback get_page_and_revision + @page.lock(Time.now, @author) end def save diff --git a/lib/url_generator.rb b/lib/url_generator.rb index 760070d7..cbfbf110 100644 --- a/lib/url_generator.rb +++ b/lib/url_generator.rb @@ -69,15 +69,15 @@ class UrlGenerator < AbstractUrlGenerator end when :publish if known_file - href = @controller.url_for :controller => 'file', :web => web_address, :action => 'file', - :id => name + href = @controller.url_for :controller => 'file', :web => web_address, :action => 'file', + :id => name, :only_path => true %{#{text}} else %{#{text}} end else href = @controller.url_for :controller => 'file', :web => web_address, :action => 'file', - :id => name + :id => name, :only_path => true if known_file %{#{text}} else @@ -98,7 +98,7 @@ class UrlGenerator < AbstractUrlGenerator when :publish if known_page href = @controller.url_for :controller => 'wiki', :web => web_address, :action => 'published', - :id => name + :id => name, :only_path => true %{#{text}} else %{#{text}} @@ -106,11 +106,11 @@ class UrlGenerator < AbstractUrlGenerator when :show if known_page href = @controller.url_for :controller => 'wiki', :web => web_address, :action => 'show', - :id => name + :id => name, :only_path => true %{#{text}} else href = @controller.url_for :controller => 'wiki', :web => web_address, :action => 'new', - :id => name + :id => name, :only_path => true %{#{text}?} end else @@ -118,11 +118,11 @@ class UrlGenerator < AbstractUrlGenerator web = Web.find_by_address(web_address) action = web.published? ? 'published' : 'show' href = @controller.url_for :controller => 'wiki', :web => web_address, :action => action, - :id => name + :id => name, :only_path => true %{#{text}} else href = @controller.url_for :controller => 'wiki', :web => web_address, :action => 'new', - :id => name + :id => name, :only_path => true %{#{text}?} end end @@ -130,7 +130,7 @@ class UrlGenerator < AbstractUrlGenerator def pic_link(mode, name, text, web_address, known_pic) href = @controller.url_for :controller => 'file', :web => web_address, :action => 'file', - :id => name + :id => name, :only_path => true case mode when :export if known_pic @@ -155,7 +155,7 @@ class UrlGenerator < AbstractUrlGenerator def media_link(mode, name, text, web_address, known_media, media_type) href = @controller.url_for :controller => 'file', :web => web_address, :action => 'file', - :id => name + :id => name, :only_path => true case mode when :export if known_media @@ -180,7 +180,7 @@ class UrlGenerator < AbstractUrlGenerator def delete_link(mode, name, web_address, known_file) href = @controller.url_for :controller => 'file', :web => web_address, - :action => 'delete', :id => name + :action => 'delete', :id => name, :only_oath => true if mode == :show and known_file %{Delete #{name}} else diff --git a/test/functional/wiki_controller_test.rb b/test/functional/wiki_controller_test.rb index cf1ae59d..b337357b 100755 --- a/test/functional/wiki_controller_test.rb +++ b/test/functional/wiki_controller_test.rb @@ -322,13 +322,13 @@ class WikiControllerTest < ActionController::TestCase assert_response(:success) assert_equal @home, r.template_objects['page'] - assert_match /That Way<\/a>/, r.body + assert_match /That Way<\/a>/, r.body r = process('show', 'web' => 'wiki1', 'id' => 'HomePage') assert_response(:success) assert_equal @home, r.template_objects['page'] - assert_match /That Way<\/a>/, r.body + assert_match /That Way<\/a>/, r.body end @@ -864,7 +864,7 @@ class WikiControllerTest < ActionController::TestCase r = process('show', 'id' => 'HomePage', 'web' => 'wiki1') assert_response :success - assert_match /Nonrecursive-include:<\/p>\n\nextra fun<\/p>\n\nHomePage<\/a><\/p>/, r.body + assert_match /Nonrecursive-include:<\/p>\n\nextra fun<\/p>\n\nHomePage<\/a><\/p>/, r.body end def test_show_page_nonexistant_page
Nonrecursive-include:<\/p>\n\n
extra fun<\/p>\n\n
HomePage<\/a><\/p>/, r.body + assert_match /Nonrecursive-include:<\/p>\n\nextra fun<\/p>\n\nHomePage<\/a><\/p>/, r.body end def test_show_page_nonexistant_page
HomePage<\/a><\/p>/, r.body end def test_show_page_nonexistant_page