friendsofagape/autographa

Data loss if more than one line entered in a field

AlisterH opened this issue · 6 comments

Playing around with editing an OBS project using autographa on Windows, I found that it is easy to cause problems (loss of unsynced data, and great confusion) by pressing ENTER in any of the edit fields, or by pasting in more than one line of text. Obviously the intention is for each field to only allow a single line of text, but the implementation really should be more foolproof.

To reproduce:

  1. edit an OBS project
  2. enter more than one line of text in any of the fields except the last "A Bible story from..." one
  3. press the back button to go back to the projects list
  4. if you inspect the markdown file you will see that the multiple lines of text were saved, but
  5. click on the project to edit it again and see that only the first line of text is loaded into the edit field
  6. press the back button to go back to the projects list
  7. if you inspect the markdown file you will see that the extra lines are now gone

Now, for a much more serious problem:

  1. edit any story in an OBS project except for the first story
  2. enter more than one line of text in the last "A Bible story from..." field
  3. press the back button to go back to the projects list
  4. click on the project to edit it again and see that the entire story has been replaced by a copy of the first story

If you select the first story instead and enter multiple lines in the "A Bible story from..." field, the first story will now be empty.

I note that the "A Bible story from..." field is probably the place where people are most likely to inadvertently enter multiple lines, because the first bit of text is the same for each chapter and will probably be copied and pasted. Someone could easily end up with a trailing line break without noticing it, and lose all their work on a story.

@AlisterH, thanks for reporting this issue. We just released v2.30 which should resolve it. Could you check and update/close this issue?

It's certainly a big improvement, but the way you're handling the title field (just preventing the user from typing multiple lines) still isn't ideal - if for some reason someone copies and pastes into it they can still input multiple lines and there is still a possibility of data loss (but only of the title).

  1. Copy and paste two or more lines of text into the title field
  2. press the back button to go back to the projects list
  3. click on the project to edit it again and see that the first line is in the title field, and the second line is in a new field labelled "0".
  4. hopefully if this happens the user will then correctly copy the contents of field "0" into the title field, and not lose any data.
  5. but if there is something actually in the title field (i.e. the first line of the original text pasted in wasn't empty), and the user tries to edit it before copying the contents of field "0", then field "0" disappears (so we have data loss).

That is true and we'll work on adding the capability. However, do you have such a use-case needing multi-line support for both text and title?

No. I didn't file the ticket to request multi-line support, I just wanted to point out that someone could paste in multiple lines without realising it, and it would result in confusion and data loss.

But for the record, it is similar to what I wanted to do. I was looking for the best way to create a reformatted and bilingual (one language above the other, on the same page) version of OBS, so I installed autographa just to see if PDFs were usually published directly from it. It looks like autographa is only used for translating and another tool is used for publishing. I will probably just use command line tools to merge the markdown files together.
Hypothetically if I was actually doing translation and was either working on a small screen or wanted an end product in two writing systems or two languages (potentially for language teaching or literacy or circulating a hard copy for review of the translation) then I can imagine it being convenient to just translate on a new line below the source language. When I was finished it would be easy to split the markdown files into separate files for each language using command line tools.

I appreciate you trying the Autographa and raising these issues. Using the CLI is probably an easier way to achieve what you are trying to do.

When translating, we tackle the need of seeing the source text close to the translation by using the resource pane. You could add a source-language OBS file in the resource pane (to the left of the editing pane) and type in your translations while referring to it conveniently on the editing pane. Of course, this is not the only way to do it but for most parts this serves the needs of those using the application. For review, the encouragement would be to use the application itself though a combined printed version maybe desirable.

closed