Ticket #361 (closed defect: fixed)

Opened 6 years ago

Last modified 6 years ago

importer: setting a non existant value in a Stringlist does not result in an error

Reported by: work@… Owned by: t.w.abma@…
Priority: major Milestone: 0.7.0
Component: Import wizard Version: 0.6.6
Keywords: Cc:
Hardware: Operating system:
Product: URL:


When importing an excel sheet into a template field which is a Stringlist, a value that does not exist in the stringlist does not result in an error, but instead the first element in the stringlist select is 'selected'.

Expected behaviour: show an error, and feedback that the value is invalid (similar to ontology).

Change History

comment:1 Changed 6 years ago by work@…


  1. stringlist contains a,b,c
  2. import d
  3. a is selected and no warning is given that you tried to import an invalid value (d)

comment:2 Changed 6 years ago by t.w.abma@…

  • Owner changed from t.w.abma@… to work@…
  • Status changed from new to assigned

Seems that this was working in the past, but now setting a value in an entity containing a STRINGLIST field doesn't seem to throw an exception anymore? This approach does work for ONTOLOGIES though.

I use a try/catch for setting a field and if a value cannot be set (in an ONTOLOGY field for example) I get an exception which I use to build up a list of fields that could not be set.

I do get an error in the log, but cannot catch this error. It would be nice if STRINGLIST also throws an exception when it fails to set a field.

"2011-03-21 17:59:52,834 [http-8080-2] ERROR studycapturing.Subject - Error casting Gender of type StringList? with value 28.02 (class java.lang.String) :: Stringlist item not recognized: 28.02"

comment:3 Changed 6 years ago by work@…

  • Owner changed from work@… to t.w.abma@…

resolved in gdt r213 and in r1664

To receive an exception use setFieldValue(name, value, true) instead of setFieldValue(name, value)

comment:4 Changed 6 years ago by t.w.abma@…

  • Status changed from assigned to closed
  • Resolution set to fixed

Solved in [215], now contains the invalid value as an option in the STRINGLIST selectbox.

Note: See TracTickets for help on using tickets.