Affects Version/s: 0.9.172
Fix Version/s: 0.9.185
Apparently following some refactoring a couple of years ago, the following code on lines 440-450 at the end of the update action in the WorksController ceased to have any use:
The reason for this is the addition of the line return unless saved a few lines higher - this bails out of the action if the chapter is not valid (can't be saved) or if the work is lacking required tags. So even if the work isn't saved, it won't be for one of those reasons (as it wouldn't reach this part) so those additional errors will never be added as far as I can see.
If we'd like the errors to be added, we could move this code up above return unless saved or take inspiration from the 2008 version of the code in Git history which used to wait until the very end of the method to return. It depends whether anyone has missed those errors when updating a work and making it invalid. Alternatively, we could remove this code.
ETA: When testing the behaviour manually, we discovered that the line return unless saved actually causes the following 500 error as there is no template associated with the `update` action:
1. Edit a work that was previously posted
2. Hit the "x" next to the only fandom tag to remove it
3. Choose "Post Without Preview"
You get an error 500 because of the above code situation.