Fix Project Wiki update
It's showing Wiki was successfully updated.
even with invalid params.
https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/controllers/projects/wikis_controller.rb#L51 doesn't seem correct since it's checking upon a WikiPage
object that's always being returned on WikiPages::UpdateService#execute
. In another words, else
will never be reached.
Steps to reproduce
- Create an project wiki page
- Update it with invalid params (no content)
- Wiki page isn't updated but
Wiki was successfully updated.
is presented
Correct behavior
- Create an project wiki page
- Update it with invalid params
- Invalid params error should appear
Thanks @dhu for bringing this up.