Project

General

Profile

Actions

Feature #2542

closed

Plugin hooks should have access to the "request" variable

Added by Douglas Manley over 15 years ago. Updated about 15 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Plugin API
Target version:
Start date:
2009-01-19
Due date:
% Done:

100%

Estimated time:
Resolution:
Fixed

Description

Plugin Hooks do not have access to the "request" variable; this makes linking from them difficult.

In my environment, we have to contend with the different ways that people access the site:
  • IP
  • redmine
  • redmine.myCompany.com

Referencing the Setting class works if the instance of Redmine is accessed only from one URL.

From Eric:

request would be best.  Problem is, request is setup in a Rails Controller but plugin hooks are not Controllers.


Redmine version: 0.8


Files

hook.rb.diff (2.47 KB) hook.rb.diff Patch for hook.rb Thomas Löber, 2009-02-02 10:00
hook.rb.revised.diff (3.29 KB) hook.rb.revised.diff Revised patch Thomas Löber, 2009-02-02 11:58
hook_test_diff_for_link_test.patch (1.48 KB) hook_test_diff_for_link_test.patch Chaoqun Zou, 2009-02-22 08:32

Related issues

Related to Redmine - Defect #2754: Setting up the default_url_options :port in hook will duplicate with the host parameter(which already contains port param) in settingsClosedEric Davis2009-02-15

Actions
Is duplicate of Redmine - Feature #2649: Need @controller context in plugin hook(view_layouts_base_html_head and view_layouts_base_body_bottom)ClosedEric Davis2009-02-02

Actions
Actions

Also available in: Atom PDF