Description
When creating or updating a task, we run several validations before storing the user data. When an error occurs, we don't save the requested changes, but rather render the input form again with an error message clearly showing the issues.
However, when we render this form again, the "alternative input" for files is shown by default, rather than the otherwise usual ACE editor used for textual input. In contrast to the textual input, the "alternative input" shows a file picker, allowing users to select a file from the local file system to upload.
The issue is that the form switches to the alternative input on validation errors, even when the standard textual input was used before. We should improve this behavior and still ensure that uploading a binary file works, even with validation errors.
Steps to reproduce:
- Go to https://codeharbor.openhpi.de/tasks/new
- Add a new file
- Only enter some value in the file content editor
- Save the task
- See the validation errors as expected. Now, move to the file previously added. You'll notice that the editor is gone and a file picker is present.
- Clicking on "Toggle file upload/editor" will show the editor again and also include the string previously entered for the new file.