Defect #14281

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

Added by Anders Lisspers about 5 years ago. Updated almost 4 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Issues
Target version:2.6.0
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

Associated revisions

Revision 13400
Added by Jean-Philippe Lang almost 4 years ago

Parent issue autocomplete does not follow to the "Allow cross-project subtasks" setting (#14281).

History

#1 Updated by Marius BALTEANU about 4 years ago

This patch works also with Redmine version 2.5.1 and is a minor change. Can be catch in the next Redmine version?

#2 Updated by Toshi MARUYAMA almost 4 years ago

  • Target version set to 2.6.0

#3 Updated by Jean-Philippe Lang almost 4 years ago

  • Subject changed from Parent issue auto complete does not follow to the "Allow cross-project issue relations" administration setting to Parent issue autocomplete does not follow to the "Allow cross-project subtasks" setting
  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang
  • Resolution set to Fixed

Parent issue selection does not depend on Setting.cross_project_issue_relations but Setting.cross_project_subtasks introduced in r10587. The fix is committed in r13400, thanks for pointing this out.

Also available in: Atom PDF