Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: openmrs/openmrs-core
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 36f2c8da3e5c
Choose a base ref
...
head repository: openmrs/openmrs-core
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 9f8c0163ef0d
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Feb 15, 2014

  1. TRUNK-3850

    suraj5 committed Feb 15, 2014

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    956e3f5 View commit details

Commits on Feb 17, 2014

  1. Merge pull request #642 from suraj5/TRUNK-3850

    TRUNK-3850
    dkayiwa committed Feb 17, 2014

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    9f8c016 View commit details
Showing with 6 additions and 8 deletions.
  1. +6 −8 api/src/main/java/org/openmrs/validator/ProgramValidator.java
14 changes: 6 additions & 8 deletions api/src/main/java/org/openmrs/validator/ProgramValidator.java
Original file line number Diff line number Diff line change
@@ -61,14 +61,12 @@ public void validate(Object obj, Errors errors) {
} else {
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "name", "error.name");
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "description", "error.description.required");
List<Program> programs = Context.getProgramWorkflowService().getAllPrograms(false);
for (Program program : programs) {
if (program.getName().equals(p.getName()) && !program.getProgramId().equals(p.getProgramId())) {
errors.rejectValue("name", "general.error.nameAlreadyInUse");
break;
} else {
Context.evictFromSession(program);
}
Program program = Context.getProgramWorkflowService().getProgramByName(p.getName());
if (program != null && !program.equals(p)) {
errors.rejectValue("name", "general.error.nameAlreadyInUse");

} else {
Context.evictFromSession(program);
}

ValidationUtils.rejectIfEmptyOrWhitespace(errors, "concept", "error.concept");