giowck / symphytum

Symphytum Personal Database Software
https://git.io/fxdRt
Other
413 stars 63 forks source link

Saving records with empty mandatory fields #140

Closed tickellsthrush closed 4 years ago

tickellsthrush commented 4 years ago

Hi,

the denotation of "mandatory fields" in symphytum form view is a little bit misleading. At least I would expect, that saving a record is only possible, if all mandatory fields are filled.

Currently, mandatory fields are only highlighted red and tremble a couple of times, if you leave them without any entry. Nonetheless you can save the record without filling any mandatory field.

joshirio commented 4 years ago

This is by design, it is only a visual aid in complex forms to quickly assess which info is really important and should be filled in.

Symphytum automatically saves the data as soon as the data of any column is changed. Refusing to save data is not really helpful because it could lead to data loss and users immediately see by the red markings which data is incomplete anyway, so I don't see any benefit of forcing users.

Unless I'm missing a clear advantage, I don't see it as a valid enhancement. Feel free to discuss. I'm open to reconsider but as of now I'll close this to focus on other improvements.

tickellsthrush commented 4 years ago

Thanks for your fast reply. The use case behind my question is recording datasets in "one-to-many" relationships.

For example, if I want to map a lecture/teacher relationship, every teacher can hold multiple lectures. In this case, I would create a mandatory "teacher-field" and several, sometimes mandatory, sometimes non-mandatory fields for room number, starting time, necessary equipment etc.. If one enters data in this teacher/lecture form and forgets to fill the mandatory field "teacher", the whole record is orphaned, because its main key is missing. At worst, the concerning record can not even assigned manually afterwards, because it is noticed weeks after saving and nobody can remember the initial intended relationship.

Additionally, the current behavior even permits to create & save entirely empty records (including mandatory fields) just by one click.

Beyond that, I think the risk of data loss due to "enforced" mandatory fields is limited, because the form with its "incomplete" inputs does not have be closed instantly. Therefore, it still can be completed after the "saving not possible due to empty mandatory field" action.

Of course it is up to you as developer to classify it as valid enhancement or not, but at least for my use case (documentation of manual changes for multiple server systems), I would appreciate it very much.