Skip to content

Resolve "Bug when Snippet creation fails"

Vijay Hawoldar requested to merge 212223-snippet-creation-bug into master

What does this MR do?

Stops the Snippet::CreateService from returning the deleted snippet to the caller (Personal/Project Snippet controllers) when it encounters an error.

This is because it trips up the path helpers when re-rendering the new snippet form, to generate urls such as snippets.123 or project-name/snippets.123.

This change re-assigns a snippet instance variable to be a duplicate of the original, so it has everything the controller needs except it won't have the old snippet ID.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Closes #212223 (closed)

Edited by 🤖 GitLab Bot 🤖

Merge request reports