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

Rename AdministrationService.validateInManualFlushMode, and refactor it and ValidateUtil

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Must
    • Resolution: Fixed
    • Affects Version/s: OpenMRS 1.9.0
    • Fix Version/s: OpenMRS 1.9.0, Platform 1.10.0
    • Component/s: None
    • Labels:
      None
    • Complexity:
      Medium

      Description

      We decided that TRUNK-3069 will not be back ported to 1.9 so it needs to be reverted in 1.9 first.

      In 1.9 we introduced an AdministrationService.validateInManualFlushMode(Object) method. In fact all validation ought to behave that way, so we want to rename the method to just AdministrationService.validate.

      In addition, we have the problem that when our controllers do something like

      new PatientValidator().validate(commandObject, errors);
      

      this can actually lead to having data prematurely flushed to the database.

      We need to let them instead do one of these, which need to run in manual flush mode:

      • ValidateUtil.validate(Object, Errors)
      • Context.getAdministrationService().validate(Object, Errors)

      Currently the AdministrationService method calls ValidateUtil, but it should probably be the other way around.

        Gliffy Diagrams

          Attachments

            Issue Links

              Attachments-Category-Modification

                Activity

                  People

                  • Assignee:
                    raff Rafal Korytkowski
                    Reporter:
                    raff Rafal Korytkowski
                  • Votes:
                    0 Vote for this issue
                    Watchers:
                    6 Start watching this issue

                    Dates

                    • Created:
                      Updated:
                      Resolved: