← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19883: minor

 

------------------------------------------------------------
revno: 19883
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-08-28 14:34:43 +0200
message:
  minor
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration-controller.js


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration-controller.js	2015-08-27 19:05:47 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration-controller.js	2015-08-28 12:34:43 +0000
@@ -70,9 +70,11 @@
         $scope.customForm = null;
         
         $scope.allProgramRules = [];
-        TrackerRulesFactory.getRules($scope.selectedProgram.id).then(function(rules){                    
-            $scope.allProgramRules = rules;
-        });
+        if( angular.isObject($scope.selectedProgram) && $scope.selectedProgram.id ){
+			TrackerRulesFactory.getRules($scope.selectedProgram.id).then(function(rules){                    
+				$scope.allProgramRules = rules;
+			});
+		}        
         
         if($scope.registrationMode === 'REGISTRATION'){
             $scope.getAttributes($scope.registrationMode);
@@ -389,4 +391,4 @@
     $scope.cancel = function () {
         $modalInstance.close(false);
     };
-});
\ No newline at end of file
+});