Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-3949

Concept Editing UI: if you have a validation error, changes are still flushed to database *and* concept names aren't properly voided

    XMLWordPrintable

    Details

      Description

      To reproduce:

      1) Create a simple concept, with a fully-specified name and a synonym

      2) Now go back and blank out the synonym, but don't hit the "remove" button

      3) Also make a change to the fully-specifed name

      4) Submit the form

      A couple things go wrong here:

      1) You get an "ugly" error message: Property synonymsByLocale[ht][0].name threw exception; nested exception is java.lang.NullPointerException

      2) If you look in the DB, you will see that the fully-specified name has been changed to the name you set in step #3 above. This should not have happened, because there was a validation failure. On top of this, the "name" column of a concept_name row should never be changed directly--whenever a concept name is changed, the old row should be voided and the new row should be created.

      I'm not quite sure where the flush happens that causes this error, but note that the "onSubmit" method of the ConceptFormController is never reached. The ConceptFormValidator is called during the call to super.processFormSubmission(request, response, object, errors) which happens within ConceptFormController.processFormSubmission.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                raff Rafal Korytkowski
                Reporter:
                mogoodrich Mark Goodrich
                Votes:
                1 Vote for this issue
                Watchers:
                5 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    Time Tracking

                    Estimated:
                    Original Estimate - 4 hours
                    4h
                    Remaining:
                    Remaining Estimate - 0 minutes
                    0m
                    Logged:
                    Time Spent - 4 hours
                    4h