Commit 24b24aff authored by Jacob Schatz's avatar Jacob Schatz

Merge branch 'discussion-outdated-form' into 'master'

Fixed JS error when trying to remove discussion form

## What does this MR do?

Fixes a JS error which was caused by an ID of the form not matching what was returned by the JSON. Instead of checking that, it gets the current form from the ajax success event.

This would only happen on outdated discussions because the ID of the discussion form ends with `-false` because it isn't active. However, the note is added to an active discussion so the ID returned actually ends in `-true` & therefore the JS couldn't find the correct form.

## What are the relevant issue numbers?

Closes #17778

See merge request !4303
parents 44cc765a d7bd7a3e
...@@ -329,7 +329,7 @@ class @Notes ...@@ -329,7 +329,7 @@ class @Notes
@renderDiscussionNote(note) @renderDiscussionNote(note)
# cleanup after successfully creating a diff/discussion note # cleanup after successfully creating a diff/discussion note
@removeDiscussionNoteForm($("#new-discussion-note-form-#{note.discussion_id}")) @removeDiscussionNoteForm($(xhr.target))
### ###
Called in response to the edit note form being submitted Called in response to the edit note form being submitted
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment