Resolve "Bug when Snippet creation fails"
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
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process.
Closes #212223 (closed)
Edited by 🤖 GitLab Bot 🤖