Skip to content

Commit

Permalink
[Issue Tracker] Fix javascript console warning multisite user (#4852)
Browse files Browse the repository at this point in the history
Fix a warning that appears in the javascript console when a user
has multiple sites affiliated.

Fixes #4727.
  • Loading branch information
driusan authored Jun 17, 2019
1 parent 3216976 commit 964dc7b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion modules/issue_tracker/jsx/IssueForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,21 @@ class IssueForm extends Component {
$.ajax(this.props.DataURL, {
dataType: 'json',
success: function(data) {
let newIssue = !data.issueData.issueID;
let formData = data.issueData;
// ensure that if the user is at multiple sites and
// its a new issue, the centerID (which is a dropdown)
// is set to the empty option instead of an array of
// the user's sites.
if (newIssue) {
formData.centerID = null;
}

this.setState({
Data: data,
isLoaded: true,
issueData: data.issueData,
formData: data.issueData,
formData: formData,
isNewIssue: !data.issueData.issueID,
});
}.bind(this),
Expand Down

0 comments on commit 964dc7b

Please sign in to comment.