]> source.dussan.org Git - redmine.git/commitdiff
Leave wiki links untouched if target project doesn't exist or have no wiki.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 10 Feb 2009 22:54:22 +0000 (22:54 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 10 Feb 2009 22:54:22 +0000 (22:54 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2436 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/application_helper.rb
test/unit/helpers/application_helper_test.rb

index 552a4cde10c69ab8dd18e7499e74612c5445da89..0fb05178c366be02c90e9ec1c36e561ee67bbe1a 100644 (file)
@@ -418,7 +418,7 @@ module ApplicationHelper
                                    :class => ('wiki-page' + (wiki_page ? '' : ' new')))
         else
           # project or wiki doesn't exist
-          title || page
+          all
         end
       else
         all
index cafa92ef4d3c1750cdcd63f8e1852c45a126ea8f..c72ab1706a6e626d6e2d9699b73c26590749e738 100644 (file)
@@ -195,6 +195,9 @@ class ApplicationHelperTest < HelperTestCase
       '-[[Another page|Page]] link-' => '<del><a href="/projects/ecookbook/wiki/Another_page" class="wiki-page">Page</a> link</del>',
       # escaping
       '![[Another page|Page]]' => '[[Another page|Page]]',
+      # project does not exist
+      '[[unknowproject:Start]]' => '[[unknowproject:Start]]',
+      '[[unknowproject:Start|Page title]]' => '[[unknowproject:Start|Page title]]',
     }
     @project = Project.find(1)
     to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) }