ibrigadir / opendatakit

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

New vesion of ODK won't run forms that functioned well before- constraint error #1012

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.opening previously working older ODK forms in ODK 1.4.3, recently installed 
from Playstore on 2 newly purchased Android devices
2.Only an error message appears
3.It reads :'bind for /AIC_followup_survey_v1.1/physical_exam/child_height 
contains invalid constraint expression [regrex(^[0-9]+.[0-9]{2})?$)] Couldn't 
understand the expression starting at the point: regrex..."

What is the expected output? What do you see instead?
I expect a fillable form. Instead there is only an error message. Old forms are 
non-functional

What version of the product are you using? On what operating system?
ODK 1.4.3 and Android Jelly Bean

Please provide any additional information below.
Can I install an older ODK version that works?
Have the regrex commands changed?

Original issue reported on code.google.com by chk_...@yahoo.com on 4 Jun 2014 at 2:19

GoogleCodeExporter commented 9 years ago
regrex isn't a valid command. regex (note that there is only one r) is. 

Can you make sure your form has regex and not regrex?

Original comment by yano...@nafundi.com on 5 Jun 2014 at 5:36

GoogleCodeExporter commented 9 years ago
Sorry. That was my typo. the actual code is 'regex' not 'regrex'

Original comment by chk_...@yahoo.com on 5 Jun 2014 at 11:36

GoogleCodeExporter commented 9 years ago
Can you attach the form to this issue or e-mail it referencing this issue?

Original comment by mitchellsundt@gmail.com on 11 Jun 2014 at 8:11

GoogleCodeExporter commented 9 years ago
Attached is an example of our previously functional forms that won't run under 
ODK 1.4.3. If I delete the sections with regex, the forms work fine.
Thanks.

Original comment by chk_...@yahoo.com on 12 Jun 2014 at 1:50

Attachments:

GoogleCodeExporter commented 9 years ago
Actually, it failed with ODK Validate for ODK Collect 1.4 rev 1037 and older 
also. In that case, however, the failure was not highlighted in red -- it was 
in blue (at the top of the error report).

Your regex expressions are not well formed -- they need to have two arguments, 
and the regex term needs to be surrounded in quotes (because it is a string).

So lines 96 and 97 were:

      <bind constraint="regex(^[0-9]+(\.[0-9]{2})?$)" nodeset="/HCC_followup_survey_v1.4/demographic_information/child_height" required="true()" type="decimal"/>
      <bind constraint="regex(^[0-9]+(\.[0-9]{1})?$)" nodeset="/HCC_followup_survey_v1.4/demographic_information/child_weight" required="true()" type="decimal"/>

They should be:

      <bind constraint="regex(.,'^[0-9]+(\.[0-9]{2})?$')" nodeset="/HCC_followup_survey_v1.4/demographic_information/child_height" required="true()" type="decimal"/>
      <bind constraint="regex(.,'^[0-9]+(\.[0-9]{1})?$')" nodeset="/HCC_followup_survey_v1.4/demographic_information/child_weight" required="true()" type="decimal"/>

Original comment by mitchellsundt@gmail.com on 12 Jun 2014 at 5:14