Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#1585 closed defect (fixed)

Problem with 'null' parameter values in plug-in configuration when handling errors

Reported by: Nicklas Nordborg Owned by: Nicklas Nordborg
Priority: major Milestone: BASE 2.17.1
Component: core Version:
Keywords: Cc:

Description

There seems to be an issue with how the plug-in configuration wizard is handling 'null' (eg. empty or not selected) parameter values. This was first seen when investigating #1584. The configuration error as such is catched and displayed for the user. But, the 'Source intensities' and 'Resulting intensities' are then marked (an 'x' in the list) as having values. Selecting one of the parameters one can see that the 'not specified' option is selected indicating that the 'x' is incorrect. Then, clicking 'Next' results in a different error:

The value '' isn't in the list of allowed values for parameter 'sourceTransform'

This indicates that the parameter has been given an empty string value instead of null.

At first, I would expect the same thing to happen if one tries to re-configure an already existing configuration, but due to a Hibernate "feature" the null value is not saved in the database. The reason that we see this behaviour after an error is that the null value is still present in the request object.

So, there seems to be two issues here:

  • We should not try to save null values, since Hibernate will not save them anyway.
  • We should not convert null values to '' when displaying the configuration form.

Change History (3)

comment:1 by Nicklas Nordborg, 13 years ago

Owner: changed from everyone to Nicklas Nordborg
Status: newassigned

comment:2 by Nicklas Nordborg, 13 years ago

Resolution: fixed
Status: assignedclosed

(In [5585]) Fixes #1585: Problem with 'null' parameter values in plug-in configuration when handling errors

comment:3 by Nicklas Nordborg, 13 years ago

(In [5626]) References #1585: Problem with 'null' parameter values in plug-in configuration when handling errors

Found another null issue in the test programs.

Note: See TracTickets for help on using tickets.