New merge request form milestone/label selectors display wrong values for MRs from forks
Partials loaded in to the new merge request form should use @target_project
, not @project
.
When creating a merge request from a fork to the main repo, that "New merge request" form is actually on gitlab.com/USERNAME/gitlab-ce/merge_requests/new. That means that @project
will refer to the source project, not the target one that the MR will end up being created in.
Since the Assignee, Milestone and Labels dropdowns should of course show data for the target project, not the source project, they should use @target_project
instead of @project
.
To make sure these partials work on the "New issue" page as well, which doesn't define @target_project
, they should have the below assignment, and then just use project
.
- project = @target_project || @project