Actions
Defect #24311
closedProject field disappears when target project disallows user to edit the project
Start date:
Due date:
% Done:
0%
Estimated time:
Resolution:
Fixed
Affected version:
Description
Issue¶
- Editing the Project Field in an Issue reloads the form
- On Reloading / Rendering the project field is excluded if the user is not allowed to change the
project_id
for issues in that project - The field disappears when the user clicks on a project where changing the project field is not allowed
- The issue cannot be moved to the other project by that user, however: The list of target projects is calculated by the right to create issues in that project. This means that there is a mismatch.
Goal¶
The project field should not disappear on selection of a project, either by showing the field more often (lax approach) or reducing the target projects list.
Suggestion¶
My suggestion for the lax approach is:
# app/views/issues/_form.html.erb
- <% if @issue.safe_attribute?('project_id') && (!@issue.new_record? || @project.nil? || @issue.copy?) %>
+ <% if (@issue.safe_attribute?('project_id') || @issue.allowed_target_projects.include?(@issue.project_id) ) && (!@issue.new_record? || @project.nil? || @issue.copy?) %>
<p><%= f.select :project_id, project_tree_options_for_select(@issue.allowed_target_projects, :selected => @issue.project), {:required => true},
:onchange => "updateIssueFrom('#{escape_javascript update_issue_form_path(@project, @issue)}', this)" %></p>
<% end %>
Files
Updated by Luka Lüdicke about 8 years ago
- File issues_form.diff issues_form.diff added
Updated by Jean-Philippe Lang about 8 years ago
- Status changed from New to Resolved
- Assignee set to Jean-Philippe Lang
- Target version set to 3.3.2
- Resolution set to Fixed
Fixed in r15959 using a slightly different solution and tests added.
Thanks for pointing this out.
Updated by Jean-Philippe Lang about 8 years ago
- Status changed from Resolved to Closed
Actions