1

Topic: Form destroyed?

I had a working customized form using the recommended Data Entry form Enter Single record... and then changed the form type to experiment with others to see how it would appear with other form types. This wiped out my form and all its customizations.

How do I get my working form back again please? I have not hit "Save" so it must still be in there somewhere...

The page is currently just giving me a load of error messages:

    Notice: Undefined index: survey_id in iform_dynamic_sample_occurrence::getAttributesForSample() (line 1005 of /home/bedscape/public_html/BRMC/indicia7/sites/all/modules/drupal-7-module-iform/client_helpers/prebuilt_forms/dynamic_sample_occurrence.php).
    Notice: Undefined index: species_include_both_names in iform_dynamic_sample_occurrence::get_form_html() (line 672 of /home/bedscape/public_html/BRMC/indicia7/sites/all/modules/drupal-7-module-iform/client_helpers/prebuilt_forms/dynamic_sample_occurrence.php).
    Notice: Undefined index: species_include_taxon_group in iform_dynamic_sample_occurrence::get_form_html() (line 673 of /home/bedscape/public_html/BRMC/indicia7/sites/all/modules/drupal-7-module-iform/client_helpers/prebuilt_forms/dynamic_sample_occurrence.php).
    Notice: Undefined index: survey_id in iform_dynamic_sample_occurrence::getFirstTabAdditionalContent() (line 1100 of /home/bedscape/public_html/BRMC/indicia7/sites/all/modules/drupal-7-module-iform/client_helpers/prebuilt_forms/dynamic_sample_occurrence.php).
    Notice: Undefined index: taxon_filter_field in iform_dynamic_sample_occurrence::get_control_species() (line 1510 of /home/bedscape/public_html/BRMC/indicia7/sites/all/modules/drupal-7-module-iform/client_helpers/prebuilt_forms/dynamic_sample_occurrence.php).
    Notice: Undefined index: list_id in iform_dynamic_sample_occurrence::get_control_species_checklist() (line 1572 of /home/bedscape/public_html/BRMC/indicia7/sites/all/modules/drupal-7-module-iform/client_helpers/prebuilt_forms/dynamic_sample_occurrence.php).
    Notice: Undefined index: survey_id in iform_dynamic_sample_occurrence::get_control_species_checklist() (line 1576 of /home/bedscape/public_html/BRMC/indicia7/sites/all/modules/drupal-7-module-iform/client_helpers/prebuilt_forms/dynamic_sample_occurrence.php).
    Notice: Undefined index: extra_list_id in iform_dynamic_sample_occurrence::get_control_species_checklist() (line 1597 of /home/bedscape/public_html/BRMC/indicia7/sites/all/modules/drupal-7-module-iform/client_helpers/prebuilt_forms/dynamic_sample_occurrence.php).

2

Re: Form destroyed?

Hi

I've tried to replicate what you describe but have not been able to. If I edit a form, change the Indicia page type, load the settings form but then view the page rather than save I get my original form back which is what you would expect.

The errors you are seeing all relate to undefined settings. I can't think of an explanation at present.

Are you able to edit the node or do you get the above errors both trying to view and edit?

Regards,
Jim Bacon.

3

Re: Form destroyed?

Hi Jim,

I am able to edit the page and when I restore the form type to be recommended Data Entry form Enter Single record... and hit load settings form it gives me all the default values for that form type (which is what I'd expect) rather than my customizations. But as I haven't hit "Save" my customizations must still be somewhere, unless changing the form type wipes them out without having to do a Save?

Regards, Keith

4

Re: Form destroyed?

Hi Keith

When you edit the page, what form type is it showing before you restore it to data entry form?

Also, how recent is your copy of the iform module - I know I'm playing with a copy from back around November.

If we continue to struggle, are you interested in looking inside the database to try to find the settings or will it be easy enough to recreate your form?

Jim Bacon

5

Re: Form destroyed?

Hi Jim,

If I exit drupal, login again and edit the form it is showing

Only recommended page types
Data entry forms
Enter single record or list of records (customisable)

which is what I had used for building my form, but the User Interface, Species, etc. configurations all contain the default values rather than my customizations.

I took a Development copy of iform from github on 14th Jan.

I can probably rebuild the form in less than an hour but this has only added to my distrust of CMSs...

Keith

6 (edited by Jim Bacon 29-01-2016 12:06:17)

Re: Form destroyed?

Hi Keith

Okay, it seems that it remembers your form type but not the other settings. I don't know how you got to this state. On a whim, I just tried changing the form type, changing it back again and then saving. To my surprise it saved and now I have a form which has lost its settings too, although I don't have the same errors as you. I would have expected the validation to have prevented it saving as, for example, the survey field is mandatory.

I wouldn't blame Drupal. Hundreds of developers and thousands of users and years of use mean it is pretty reliable.

More likely, if there is a bug, it is in our code. I would say that the action that got you to this point is not part of a typical workflow so you might have exercised some relatively untested code. Apologies if this is the case. If you are able to come up with a repeatable demonstration of the problem then we can determine the cause and probably fix it.

Obviously, if you recreate your form, you won't want to go and lose it all over again to show it is a repeatable problem! The Clone module, https://www.drupal.org/project/node_clone, is one we find useful for duplicating a node quickly.

Regards,
Jim Bacon.