Project

General

Profile

Actions

Patch #2856

closed

Redmine::WikiFormatting.register not raise ArgumentError

Added by Narihiro Nakamura almost 16 years ago. Updated almost 16 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Start date:
2009-02-27
Due date:
% Done:

0%

Estimated time:

Description

Hi.

Redmine::WikiFormatting.register not raise ArgumentError.

./script/console
001:>> Redmine::WikiFormatting.register("foo", "bar", "baz") #=> {:helper=>"baz", :formatter=>"bar"}
002:>> Redmine::WikiFormatting.register("foo", "bar", "baz") #=> {:helper=>"baz", :formatter=>"bar"}
003:>> Redmine::WikiFormatting.register("foo", "bar", "baz") #=> {:helper=>"baz", :formatter=>"bar"}

I maked patch for fix this bug.

./script/console
001:>Redmine::WikiFormatting.register("foo", "bar", "baz") #=> {:helper=>"baz", :formatter=>"bar"}
002:>> Redmine::WikiFormatting.register("foo", "bar", "baz")
ArgumentError: format name 'foo' is already taken

thanks.

Index: lib/redmine/wiki_formatting.rb
===================================================================
--- lib/redmine/wiki_formatting.rb      (revision 2480)
+++ lib/redmine/wiki_formatting.rb      (working copy)
@@ -25,7 +25,7 @@
       end

       def register(name, formatter, helper)
-        raise ArgumentError, "format name '#{name}' is already taken" if @@formatters[name]
+        raise ArgumentError, "format name '#{name}' is already taken" if @@formatters[name.to_sym]
         @@formatters[name.to_sym] = {:formatter => formatter, :helper => helper}
       end
Actions #1

Updated by Jean-Philippe Lang almost 16 years ago

  • Status changed from New to Closed
  • Target version set to 0.9.0

Applied in r2562. Thanks.

Actions

Also available in: Atom PDF