diff --git a/omod/src/main/java/org/openmrs/module/dhisreport/web/controller/LocationMappingController.java b/omod/src/main/java/org/openmrs/module/dhisreport/web/controller/LocationMappingController.java index babbc12..0b5fa7e 100644 --- a/omod/src/main/java/org/openmrs/module/dhisreport/web/controller/LocationMappingController.java +++ b/omod/src/main/java/org/openmrs/module/dhisreport/web/controller/LocationMappingController.java @@ -119,13 +119,13 @@ public void showConfigForm(ModelMap model, WebRequest webRequest) { @RequestMapping(value = "/module/dhisreport/mapLocations", method = RequestMethod.POST) public String mapLocations(ModelMap model, - @RequestParam(value = "DHIS2OrgUnits", required = true) String dhis2OrgUnitCode, + @RequestParam(value = "DHIS2OrgUnits", required = false) String dhis2OrgUnitCode, @RequestParam(value = "openmrsLocations", required = true) String openmrsLocationName, WebRequest webRequest) { System.out.println("org unit does not exits and it is : " + dhis2OrgUnitCode); String referer = webRequest.getHeader("Referer"); - if (dhis2OrgUnitCode.equals("")) { + if (dhis2OrgUnitCode == null || dhis2OrgUnitCode.isEmpty()) { System.out.println("org unit does not exits"); webRequest.setAttribute(WebConstants.OPENMRS_MSG_ATTR, Context.getMessageSourceService().getMessage("dhisreport.orgUnitCodeDoesNotExist"), diff --git a/omod/src/main/webapp/mapLocations.jsp b/omod/src/main/webapp/mapLocations.jsp index c26d1c5..b8d4815 100644 --- a/omod/src/main/webapp/mapLocations.jsp +++ b/omod/src/main/webapp/mapLocations.jsp @@ -37,7 +37,7 @@ -