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

Show helpful message when purging in-use Field Types

    XMLWordPrintable

Details

    Description

      When deleting a FieldType that is in use, the user sees this ugly error and stack trace:
      org.springframework.dao.DataIntegrityViolationException: Could not execute JDBC batch update; SQL [delete from field_type where field_type_id=?]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationExcept

      Stack trace:
      org.openmrs.web.controller.form.FieldTypeListController.onSubmit(FieldTypeListController.java:73)
      at [ignored] ...
      javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      <snip>

      Instead, the user should see the pink error box with a message saying it can't be deleted. See TRUNK-656 for an example of what to do.

      Gliffy Diagrams

        Attachments

          Issue Links

            Activity

              People

                robmiles Rob Miles
                bwolfe Ben Wolfe
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Time Tracking

                    Estimated:
                    Original Estimate - 1 hour
                    1h
                    Remaining:
                    Remaining Estimate - 1 hour
                    1h
                    Logged:
                    Time Spent - Not Specified
                    Not Specified