mohan-nishit / opendatakit

Automatically exported from code.google.com/p/opendatakit
0 stars 0 forks source link

Collect crashing when entering data in nested group #291

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open attached form and enter details as required. 
2. Add a 'New structure' group and then a 'New Room' group.
3. The program crashes immediately and requires a 'Force Close'

What version of the product are you using? On what operating system?
ODK Collect 1.1.7 RC1

Original issue reported on code.google.com by danieljb...@gmail.com on 5 Aug 2011 at 6:15

Attachments:

GoogleCodeExporter commented 9 years ago
the error is in the form. try this change...

<bind nodeset="/data/Structures/Rooms/Porous" type="select1" 
relevant="(/data/Structures/Rooms/RoomPermission= 1)"/>
<bind nodeset="/data/Structures/Rooms/NetsObserved" type="int" 
relevant="(/data/Structures/Rooms/RoomPermission= 1)" constraint="(. > 1 and . 
< 15)"/>
<bind nodeset="/data/Structures/Rooms/Refusal" type="select1" 
relevant="(/data/Structures/Rooms/RoomPermission= 2)"/>

this is a runtime error that the javarosa (and thus validate) should catch, but 
that requires iterating through every tree in the form. i'll let carl decide 
how to catch and display this one.

FATAL EXCEPTION: main
org.javarosa.xpath.XPathTypeMismatchException: XPath evaluation: type mismatch 
Node /data/RoomPermission does not exist!
    at org.javarosa.xpath.expr.XPathPathExpr.eval(XPathPathExpr.java:146)
    at org.javarosa.xpath.expr.XPathPathExpr.eval(XPathPathExpr.java:49)
    at org.javarosa.xpath.expr.XPathEqExpr.eval(XPathEqExpr.java:42)
    at org.javarosa.xpath.XPathConditional.evalRaw(XPathConditional.java:68)
    at org.javarosa.xpath.XPathConditional.eval(XPathConditional.java:72)
    at org.javarosa.core.model.condition.Condition.eval(Condition.java:62)
    at org.javarosa.core.model.condition.Triggerable.apply(Triggerable.java:56)
    at org.javarosa.core.model.FormDef.evaluateTriggerable(FormDef.java:622)
    at org.javarosa.core.model.FormDef.evaluateTriggerables(FormDef.java:612)
    at org.javarosa.core.model.FormDef.initializeTriggerables(FormDef.java:569)
    at org.javarosa.core.model.FormDef.createNewRepeat(FormDef.java:310)
    at org.javarosa.form.api.FormEntryController.newRepeat(FormEntryController.java:234)
    at org.javarosa.form.api.FormEntryController.newRepeat(FormEntryController.java:248)
    at org.odk.collect.android.logic.FormController.newRepeat(FormController.java:377)
    at org.odk.collect.android.activities.FormEntryActivity$2.onClick(FormEntryActivity.java:941)
    at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:159)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:130)
    at android.app.ActivityThread.main(ActivityThread.java:3835)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:507)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
    at dalvik.system.NativeStart.main(Native Method)
   Force finishing activity org.odk.collect.android/.activities.FormEntryActivity
 Activity pause timeout for HistoryRecord{4090d738 org.odk.collect.android/.activities.FormEntryActivity}
 Launch timeout has expired, giving up wake lock!
 Activity idle timeout for HistoryRecord{40660068 org.odk.collect.android/.activities.MainMenuA

Original comment by yanokwa on 5 Aug 2011 at 6:32

GoogleCodeExporter commented 9 years ago
this should really be handled at parse time, not runtime, but I can put in a 
catch to at least display the error to the user.

Original comment by carlhart...@gmail.com on 27 Sep 2011 at 9:10

GoogleCodeExporter commented 9 years ago
This issue was closed by revision bb257332a959.

Original comment by carlhart...@gmail.com on 27 Sep 2011 at 9:30