Project

General

Profile

Actions

Defect #14281

closed

Parent issue autocomplete does not follow to the "Allow cross-project subtasks" setting

Added by Anders Lisspers over 11 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Normal
Category:
Issues
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

When editing an issue, you're able to get auto completion for the parent issue ID by typing a search term in the input box. However, as of r10587 this does not search the current project's issues but issues across all projects.

If I understand correctly, the call to #{escape_javascript auto_complete_issues_path} on line 46 of app/views/issues/_attributes.html.erb should (1) pass the current projects ID as project_id parameter and (2) pass the scope parameter depending on the "Allow cross-project issue relations" administration setting.

A change of line 46 in _attributes.html.erb as follows has been tested and seems to be working in our environment at least:

-<%= javascript_tag "observeAutocompleteField('issue_parent_issue_id', '#{escape_javascript auto_complete_issues_path}')" %>
+<%= javascript_tag "observeAutocompleteField('issue_parent_issue_id', '#{escape_javascript auto_complete_issues_path(:project_id => @issue.project, :scope => (Setting.cross_project_issue_relations? ? 'all' : nil))}')" %>

$ ruby script/about

Environment:
  Redmine version                          2.2.2.stable
  Ruby version                             1.8.7 (x86_64-linux)
  Rails version                            3.2.11
  Environment                              production
  Database adapter                         Mysql2
Redmine plugins:
  redmine_add_subissue_menuitem            0.0.1
  redmine_favourite_projects               0.6.2
  redmine_ics_export                       2.0.0.dev
  redmine_knowledgebase                    2.2.0
  redmine_time_tracker                     0.4

Actions

Also available in: Atom PDF