After error in New Project form, error message takes user to default tab (blank instead of 'from template')

Summary

When there is an error in the submitted form for New Project, and the user was on a different tab than the default (for example, create new project from template), the user will see the error message in the default tab (new blank project) and not the tab he was originally in. This ios very confusing and hard to notice, so the user will most likely fix the error in the form, then resubmits, and then will be surprised to find out that the new project is a blank one (and not from the template he chose prior to the first submit of the form).

Steps to reproduce

  1. Click to create a new project
  2. Click the Create From Template tab
  3. Choose whatever template from the list and click 'Use Template'
  4. Give a name to your intended new project. Use a name for an already existing project on that namespace
  5. Click Create Project to submit
  6. After rendering the request, you see the error message for the already-in-use project name. The tab, however, is the default Blank Project tab and not the From Template tab.

What is the current bug behavior?

User is shown the error message on the default tab instead of originally used tab.

What is the expected correct behavior?

User will be shown the error message on the same tab he was originally submitting from.

Output of checks

This bug happens on GitLab.com

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:env:info)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes

(If you can, link to the line of code that might be responsible for the problem)

Edited Oct 28, 2019 by Osnat Vider
Assignee Loading
Time tracking Loading