gaiaresources / ala-citizenscience

Automatically exported from code.google.com/p/ala-citizenscience
1 stars 4 forks source link

Changing attribute type from census method type to anything else breaks survey export #382

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a survey containing a matrix data type. (assign a valid census method 
to the attribute).
2. Save the the survey.
3. Edit the survey and change the attribute type to any other type.
4. Export the survey.
5. Import the survey somewhere else.

What is the expected output? What do you see instead?
Expect that the survey could be exported and imported.  Instead the reference 
to the old census method is hanging around but not included in the export.

The census method id should be cleared when the attribute type is changed to a 
non-census method type.

Please use labels and text to provide additional information.

Original issue reported on code.google.com by chris.go...@gmail.com on 14 Dec 2012 at 4:13

GoogleCodeExporter commented 9 years ago
Change to AttributeInstanceFormField constructor:
Added else block (line 153) as per below:
        if (AttributeType.isCensusMethodType(this.attribute.getType())) {
           ...
           this.attribute.setCensusMethod(cm);
        }
        else {
            this.attribute.setCensusMethod(null);
        }

Original comment by chris.go...@gmail.com on 14 Dec 2012 at 4:18

GoogleCodeExporter commented 9 years ago
reviewed and accepted by a.low

Original comment by aaron.lo...@gmail.com on 14 Dec 2012 at 4:21

GoogleCodeExporter commented 9 years ago

Original comment by chris.go...@gmail.com on 17 Dec 2012 at 4:50