Uploaded image for project: 'Kuali Rice Development'
  1. Kuali Rice Development
  2. KULRICE-12849

Able to create a TravelAccount with a fiscal officer that does not exist, even if a defaultExistenceChecks exists for it.

    Details

    • Type: Bug Fix
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.5
    • Fix Version/s: 2.5
    • Security Level: Public (Public: Anyone can view)
    • Labels:
      None
    • Sprint:
      Core 2.5.0-m6 Sprint 1
    • KAI Review Status:
      Not Required
    • KTI Review Status:
      Not Required
    • Code Review Status:
      Not Required
    • Include in Release Notes?:
      Yes
    • Story Points:
      3

      Description

      Links to test locally:
      Labs - Maintenance Views: http://localhost:8080/krad-dev/kr-krad/labs?viewId=LabsMenuMaintenanceView
      Existence Demo: http://localhost:8080/krad-dev/kr-krad/kradsampleapp?viewId=KradMaintenanceSample-PageR6C1

      The fiscalOfficer on the travel account is defaulted to a PersonImpl object, so when validateReferenceExists is called the referenceDataObject that is returned is a PersonImpl object that has all the fields set to empty strings or null. true is returned from validateReferenceExists since the object itself is not null. Another issue may be that when getReferenceIfExists is called, DataObjectWrapperBase.fetchRelationship does nothing since org.kuali.rice.kim.api.identity.Person is a related type that is not supported by DataObjectService.

      Code in DictionaryValidationServiceImpl (comments are a bit confusing in this method):

      public boolean validateReferenceExists(Object dataObject, String referenceName) {
           // attempt to retrieve the specified object from the db
           Object referenceDataObject = getLegacyDataAdapter().getReferenceIfExists(dataObject, referenceName);
      
           // if it isn't there, then it doesn't exist, return false
           if (KRADUtils.isNotNull(referenceDataObject)) {
               return true;
           }
      
           // otherwise, it is there, return true
           return false;
      }
      

        Attachments

          Issue Links

            Activity

            shahess Shannon Hess created issue -
            shahess Shannon Hess made changes -
            Field Original Value New Value
            Description Labs - Maintenance Views: http://localhost:8080/krad-dev/kr-krad/labs?viewId=LabsMenuMaintenanceView
            Existence Demo: http://localhost:8080/krad-dev/kr-krad/kradsampleapp?viewId=KradMaintenanceSample-PageR6C1
            \\
            \\
            The fiscalOfficer on the travel account is defaulted to a PersonImpl object, so when validateReferenceExists is called the referenceDataObject that is returned is a PersonImpl object that has all the fields set to empty strings or null. true is returned from validateReferenceExists since the object itself is not null. Another issue may be that when getReferenceIfExists is called, DataObjectWrapperBase.fetchRelationship does nothing since org.kuali.rice.kim.api.identity.Person is a related type that is not supported by DataObjectService.

            Code in DictionaryValidationServiceImpl (comments are a bit confusing in this method):
            {code}
            public boolean validateReferenceExists(Object dataObject, String referenceName) {
                 // attempt to retrieve the specified object from the db
                 Object referenceDataObject = getLegacyDataAdapter().getReferenceIfExists(dataObject, referenceName);

                 // if it isn't there, then it doesn't exist, return false
                 if (KRADUtils.isNotNull(referenceDataObject)) {
                     return true;
                 }

                 // otherwise, it is there, return true
                 return false;
            }
            {code}
            Links to test locally:
            Labs - Maintenance Views: http://localhost:8080/krad-dev/kr-krad/labs?viewId=LabsMenuMaintenanceView
            Existence Demo: http://localhost:8080/krad-dev/kr-krad/kradsampleapp?viewId=KradMaintenanceSample-PageR6C1
            \\
            \\
            The fiscalOfficer on the travel account is defaulted to a PersonImpl object, so when validateReferenceExists is called the referenceDataObject that is returned is a PersonImpl object that has all the fields set to empty strings or null. true is returned from validateReferenceExists since the object itself is not null. Another issue may be that when getReferenceIfExists is called, DataObjectWrapperBase.fetchRelationship does nothing since org.kuali.rice.kim.api.identity.Person is a related type that is not supported by DataObjectService.

            Code in DictionaryValidationServiceImpl (comments are a bit confusing in this method):
            {code}
            public boolean validateReferenceExists(Object dataObject, String referenceName) {
                 // attempt to retrieve the specified object from the db
                 Object referenceDataObject = getLegacyDataAdapter().getReferenceIfExists(dataObject, referenceName);

                 // if it isn't there, then it doesn't exist, return false
                 if (KRADUtils.isNotNull(referenceDataObject)) {
                     return true;
                 }

                 // otherwise, it is there, return true
                 return false;
            }
            {code}
            shahess Shannon Hess made changes -
            Link This issue discovered by KULRICE-11488 [ KULRICE-11488 ]
            shahess Shannon Hess made changes -
            Fix Version/s 2.5 [ 17044 ]
            kbtaylor Kristina Taylor (Inactive) made changes -
            Rank Ranked higher
            kbtaylor Kristina Taylor (Inactive) made changes -
            Rank Ranked lower
            gilesp Peter Giles (Inactive) made changes -
            Flagged Impediment [ 13060 ]
            gilesp Peter Giles (Inactive) made changes -
            Flagged Impediment [ 13060 ]
            kbtaylor Kristina Taylor (Inactive) made changes -
            Component/s KNS Equivalency [ 13684 ]
            kbtaylor Kristina Taylor (Inactive) made changes -
            Sprint Core 2.5.0-m6 Sprint 1 [ 353 ]
            kbtaylor Kristina Taylor (Inactive) made changes -
            Rank Ranked lower
            kbtaylor Kristina Taylor (Inactive) made changes -
            Original Estimate 1 day [ 28800 ]
            Remaining Estimate 1 day [ 28800 ]
            cniesen Claus Niesen made changes -
            Sprint Core 2.5.0-m5 Sprint 2b [ 353 ] Core 2.5.0-m6 Sprint 1 [ 359 ]
            kbtaylor Kristina Taylor (Inactive) made changes -
            Sprint Core 2.5.0-m6 Sprint 1 [ 359 ] Core 2.5.0-m5 Sprint 2b [ 353 ]
            kbtaylor Kristina Taylor (Inactive) made changes -
            Rank Ranked lower
            kbtaylor Kristina Taylor (Inactive) made changes -
            Sprint Core 2.5.0-m5 Sprint 2b [ 353 ] Core 2.5.0-m6 Sprint 1 [ 359 ]
            kbtaylor Kristina Taylor (Inactive) made changes -
            Rank Ranked higher
            kbtaylor Kristina Taylor (Inactive) made changes -
            Original Estimate 1 day [ 28800 ]
            Remaining Estimate 1 day [ 28800 ]
            kbtaylor Kristina Taylor (Inactive) made changes -
            Original Estimate 3 days [ 86400 ]
            Remaining Estimate 3 days [ 86400 ]
            sedgar Steve Edgar (Inactive) made changes -
            Assignee Steve Edgar [ sedgar ]
            sedgar Steve Edgar (Inactive) made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            kbtaylor Kristina Taylor (Inactive) made changes -
            Original Estimate 3 days [ 86400 ]
            Remaining Estimate 3 days [ 86400 ]
            Story Points 3
            sedgar Steve Edgar (Inactive) made changes -
            Status In Progress [ 3 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            masargen Matt Sargent made changes -
            Status Resolved [ 5 ] Closed [ 6 ]

              People

              • Assignee:
                sedgar Steve Edgar (Inactive)
                Reporter:
                shahess Shannon Hess
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: