title_editor: fix multi-lines titles update error if missing line 1 (Fixes #5864) #5865
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #5864
Example: "Standard 3" title:
if line 1 and line 3 are missing, then line 2 is immutable (can not update).
if line 1 is missing, then update to line 2 is lost and update to line 3 becomes line 2.
Note that if line 3 is missing, then update to line 1 and line 2 are working fine.
The fix is to always display all the lines, even if they are empty, which fixes all the update problems above.
Since all the lines are displayed, even those previously empty, the fix also allows to set new values for those previously empty lines.
This removes the previous restriction that once a line is empty, it disappears from the title editor, meaning the end-user can not change its mind and set a value for those line again. Now the end-user can change its mind anytime. Any lines can change from being empty or not, any time.
Manually tested against "Standard 3" and "Standard 4" titles, but I believe this fix will impact all multi-lines titles. Is there an automated way to test all of them?