There is a nasty problem when you change forms; there is a risk of data loss.
- Create a form with a field called ManWithRedShirt
- Create a topic that uses the form. Populate it with data and save it.
- Edit the form and delete the ManWithRedShirt field row, and save it
- View the topic. Everything looks good, yes? Now edit it.
- In best Star-Trek tradition, ManWithRedShirt has been eaten by aliens, taking all your carefully crafted data with it.
- If you then save the topic, even a carefully focused transporter beam won't bring it back.
Of course, you can go "back" and copy-paste the data to a safe place. But that's really not a very elegant solution; you may not even realise it has gone. So here are a couple of possible scenarios covering the situation where a FIELD is in META but no longer in the form def for you to consider:
- the lost key/value pair(s) are silently added to the end of the text
- the lost key/value pair(s) are listed before the form table, in bright red with a message saying they are going to be deleted if the topic is saved.
--
CrawfordCurrie - 08 Apr 2005
Hmmm. Interesting question. Easy to detect to when the data is about to be lost... we would just need to find a good user interaction model here.
- Your first suggestion will look ugly but preserves the data.
- Your second suggestion does not really get you the data, but you can find it by going back in the browser (assuming the form is actually shown, which is not a given... a template might decide not to render the form.
But thinking some more about it... the form is an application which keeps structured data. If the structure changes so that ManWithRedShirt is not part of the structure, the data related to ManWithRedShirt should cease to exist, shouldn't it? (I would have called it GuyWithoutAName... as in the great sci fi parody Galaxy Quest...)
--
ThomasWeigert - 08 Apr 2005
My main issue is with the following use case: The originator of the form creates the field ManWithRedShirt, but a GalaxyQuest fan comes along and renames the field to GuyWithoutAName - same data, different key, but data is thrown away all the same.
Note that if you are lucky enough to be using
RCS you will still be able to get the data from the history - if you realise it is missing - but it will of course have disappeared from searches.
--
CrawfordCurrie - 09 Apr 2005
Would it help if, instead of writing:
% META:FORM{name="ChangeProposalForm"}%
% META:FIELD{name="TopicClassification" title="TopicClassification" value="BugReport"}%
% META:FIELD{name="TopicSummary" title="TopicSummary" value="Form data gets eaten by aliens if the form def is changed"}%
We embedded the form name in every key and wrote:
% META:FIELD{form="ChangeProposalForm" name="TopicClassification" title="TopicClassification" value="BugReport"}%
% META:FIELD{form="ChangeProposalForm" name="TopicSummary" title="TopicSummary" value="Form data gets eaten by aliens if the form def is changed"}%
?
--
MartinCleaver - 09 Apr 2005
It might help. That is a good idea for another reason as well; it allows the support of multiple forms in a topic. But it's a major rewrite of the Forms support.
--
CrawfordCurrie - 09 Apr 2005
Yea for
AllowMultipleForms!
--
LynnwoodBrown - 09 Apr 2005
I don't think adding the form name to the field definition helps when the form layout itself is changed. It would help avoid data loss when the form is swapped for another form (or removed altogether).
--
ThomasWeigert - 10 Apr 2005
Crawford, if you only allow editing for one form at a time this is not as big a rewrite. The format Martin describes is very similar to the format we use in
SimpleTableEntryUsingForms, and this already allows multiple tables per topic.
The issue is more one of deciding whether the form application is a different application from the white board application, and how to integrate multiple forms in the user interface. This is where most of the changes will be... how do we add another form? do they just get added at the bottom one by one? can they be in the text? etc.
The requirements need to be worked out.
--
ThomasWeigert - 10 Apr 2005
See
RequirementsForMultipleFormSupport
This will
not be solved before we do multiple forms per topic.
--
CrawfordCurrie - 10 Apr 2005