What happens when a field name change
Kotahi allows the user to change the field name (a key) of any input of the form
The field name should be equivalent in the DB and in the interface, that way the flax developer / user can easily find where is the data is looking for, as Flax need to know the exact schema of the dataset to create a sensible layout.
So any change in the field name will bring a change in Flax.
What happens today when a field name has changed, a new manuscripts are coming in, is the following:
manuscript 1 added before the change, manuscript 2 added after:
old field | new field | |
---|---|---|
manuscript 1 | data | empty |
manuscript 2 | empty | data |
That means that Flax will get into “if” loop to check for each field. And if, for some reason the two fields are filled, it’s gonna be impossible to know which one is the accurate.
We can’t totally provide a mapping from a field to another because, if for some reason (a user typing error for example) the field change name twice in a row, it’s hard to keep the track of the name changes
Possible options:
- when updating the field name, update every object to use the new one (by duplicating the value in the new key) [this can be tedious if there are a lot of manuscript]
- transform the data in flax to map the output (could be great with a configuration file, but it add a translation layer that bring noise if kotahi data come in clean)