Commit Graph

6 Commits

Author SHA1 Message Date
Eric Davis 4baf32b166 Fixing Plugin and Mailer default_url_options.
Both the plugin hooks and Mailer were setting default_url_options incorrectly
and causing ActionContoller::UrlWritter to cache the settings on the module
(mattr_accessor) causing several url generators to fail in either the plugin
hooks or the Mailer.

* Replaced Mailer's use of the default_url_options accessor with the proper class method
* Replaced Hook's use of the default_url_options accessor with the proper class method on the ViewListener class
* Added a test to reproduce the bugs in the Mailer when a hook is registered (thanks Chaoqun Zou)

  #2542

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2522 e93f8b46-1217-0410-a6f0-8f06a7374b81
2009-02-25 07:25:01 +00:00
Eric Davis 9a986ac0a5 Refactored the mess known as Hook default_url_options in favor of the simpler
:only_path as suggested by splatteal on GitHub.

  #2542

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2491 e93f8b46-1217-0410-a6f0-8f06a7374b81
2009-02-21 00:23:28 +00:00
Eric Davis 00b568c194 Implementing the missing tests now that HookTest has a cleaner setup.
Controller and Views are now tested through the Redmine::Hook::Helper module.

  #2542

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2490 e93f8b46-1217-0410-a6f0-8f06a7374b81
2009-02-21 00:23:22 +00:00
Eric Davis b6c4b21b47 Refactored the HookTest methods to use Redmine::Hook::Helper instead
of the Redmine::Hook class directly.  Redmine::Hook::Helper is the
public API so it should be one that is tested.

  #2542

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2489 e93f8b46-1217-0410-a6f0-8f06a7374b81
2009-02-21 00:23:16 +00:00
Eric Davis 5b7a5c39a7 Added request and controller objects to the hooks by default.
The request and controller objects are now added to all hook contexts by
default.  This will also make url_for work better in hooks by setting up
the default_url_options :host, :port, and :protocol.

Finally a new helper method @render_or@ has been added to ViewListener.  This
will let a hook easily render a partial without a full method definition.

Thanks to Thomas Löber for the original patch.  #2542

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2429 e93f8b46-1217-0410-a6f0-8f06a7374b81
2009-02-10 03:12:40 +00:00
Jean-Philippe Lang f7acdd1afd Merged hooks branch @ r1785 into trunk.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1786 e93f8b46-1217-0410-a6f0-8f06a7374b81
2008-09-05 10:31:06 +00:00