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

Related keys on collections are not being set on add line

    Details

    • Type: Bug Fix
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-rc1
    • Fix Version/s: 2.0.0-rc2, 2.0
    • Component/s: Development
    • Security Level: Public (Public: Anyone can view)
    • Labels:
      None
    • Rice Module:
      KNS
    • Application Requirement:
      KFS
    • KAI Review Status:
      Not Required
    • KTI Review Status:
      Not Required

      Description

      It looks like something changed on collections under Rice 2.0. Now, when I use the Add button on collections in maintenance documents, I am getting error messages about the linking key (parent object PK) not being populated on the collection object (required field error).

      I don't exactly know when this was populated in 1.x. But, the workaround is to manually intercept the add line in the maintainable and set the fields. This was not necessary in 1.x and will be extremely time consuming to add. (In addition to requiring custom maintainables for every maintenance document which contains a collection.)

      I don't know if they are not being set, or if the validation is firing too soon. But, in any case, it is breaking every KNS maintenance document which contains a collection at the moment. I'm going to see if I can find any more information, but I wanted to give you a heads up on this one.

        Attachments

          Issue Links

            Activity

            Hide
            jkeller Jonathan Keller added a comment -

            I've confirmed that it is the validation. But I don't see any code which ever copied those values. Was it something OJB did? Or, was it that the validation was not being enforced on these fields in general. It could be that the document I'm working on has required attributes on these hidden fields while most don't. But, this document was working before the upgrade. So, I'm worried that some baseline behavior of the ORM-mapping layer has not changed.

            Show
            jkeller Jonathan Keller added a comment - I've confirmed that it is the validation. But I don't see any code which ever copied those values. Was it something OJB did? Or, was it that the validation was not being enforced on these fields in general. It could be that the document I'm working on has required attributes on these hidden fields while most don't. But, this document was working before the upgrade. So, I'm worried that some baseline behavior of the ORM-mapping layer has not changed.
            Hide
            jkeller Jonathan Keller added a comment -

            I found the problem. It's in: org.kuali.rice.krad.service.impl.DictionaryValidationServiceImpl

            The KNS method on this class shown below is no longer passing the "validateRequired" parameter. This is required for add line and save operations.

                /**
                 * @see org.kuali.rice.krad.service.DictionaryValidationService#validateBusinessObject(org.kuali.rice.krad.bo.BusinessObject,
                 *      boolean)
                 */
                @Override
                public void validateBusinessObject(BusinessObject businessObject, boolean validateRequired) {
                    if (ObjectUtils.isNull(businessObject)) {
                        return;
                    }
            
                    validate(businessObject, businessObject.getClass().getName());
                }
            
            Show
            jkeller Jonathan Keller added a comment - I found the problem. It's in: org.kuali.rice.krad.service.impl.DictionaryValidationServiceImpl The KNS method on this class shown below is no longer passing the "validateRequired" parameter. This is required for add line and save operations. /** * @see org.kuali.rice.krad.service.DictionaryValidationService#validateBusinessObject(org.kuali.rice.krad.bo.BusinessObject, * boolean) */ @Override public void validateBusinessObject(BusinessObject businessObject, boolean validateRequired) { if (ObjectUtils.isNull(businessObject)) { return; } validate(businessObject, businessObject.getClass().getName()); }
            Hide
            jkeller Jonathan Keller added a comment -

            It seems that the solution to this one may be to simply pass the validateRequired parameter into one of the other versions of the validate() method which takes the doOptionalProcessing parameter. That seems to have the same effect further down the stack.

            Show
            jkeller Jonathan Keller added a comment - It seems that the solution to this one may be to simply pass the validateRequired parameter into one of the other versions of the validate() method which takes the doOptionalProcessing parameter. That seems to have the same effect further down the stack.
            Hide
            ewestfal Eric Westfall added a comment -

            Since this is KRAD-related, set Jerry as the lead and assignee and he can distribute to appropriate team members in order to fix.

            Show
            ewestfal Eric Westfall added a comment - Since this is KRAD-related, set Jerry as the lead and assignee and he can distribute to appropriate team members in order to fix.
            Hide
            jkeller Jonathan Keller added a comment -

            FYI - KFS is now running on a customized build of 2.0.0 RC1 where I made the change I suggested above. That fixed the problem until we get RC2.

            Show
            jkeller Jonathan Keller added a comment - FYI - KFS is now running on a customized build of 2.0.0 RC1 where I made the change I suggested above. That fixed the problem until we get RC2.
            Hide
            jkneal Jerry Neal (Inactive) added a comment -

            Hey Jonathan,

            Would you mind to attache a patch so I can take a look at what you did?

            I did some recent work on this because to essentially make the KNS use the old validation code (based on patterns) instead of the new validation code (based on constraints). But I can't remember if that was before rc1 or after.

            thanks,
            Jerry

            Show
            jkneal Jerry Neal (Inactive) added a comment - Hey Jonathan, Would you mind to attache a patch so I can take a look at what you did? I did some recent work on this because to essentially make the KNS use the old validation code (based on patterns) instead of the new validation code (based on constraints). But I can't remember if that was before rc1 or after. thanks, Jerry
            Hide
            jkeller Jonathan Keller added a comment -

            Jerry,

            All I did was change that method from the earlier comment to:

            validate(businessObject, businessObject.getClass().getName(), validateRequired);
            

            I initially made the change against the trunk, but I could not get the dependencies to resolve during the compile, so I fell back to rc1. But, the code was the same, as I did not lose my modification during the SVN switch back to the rc1 tag.

            Show
            jkeller Jonathan Keller added a comment - Jerry, All I did was change that method from the earlier comment to: validate(businessObject, businessObject.getClass().getName(), validateRequired); I initially made the change against the trunk, but I could not get the dependencies to resolve during the compile, so I fell back to rc1. But, the code was the same, as I did not lose my modification during the SVN switch back to the rc1 tag.
            Hide
            jkneal Jerry Neal (Inactive) added a comment -

            Ok, thanks.

            I believe this was before the changes we made. Since now the KNS dictionary validation service overrides the method as follows:

            public void validateBusinessObject(BusinessObject businessObject, boolean validateRequired) {
            if (ObjectUtils.isNull(businessObject))

            { return; }

            try

            { // validate the primitive attributes of the bo validatePrimitivesFromDescriptors(businessObject.getClass().getName(), businessObject, PropertyUtils.getPropertyDescriptors(businessObject.getClass()), "", validateRequired); }

            catch (RuntimeException e)

            { LOG.error(String.format("Exception while validating %s", businessObject.getClass().getName()), e); throw e; }

            }

            Which is what it did previous to 2.0.

            thanks,
            Jerry

            Show
            jkneal Jerry Neal (Inactive) added a comment - Ok, thanks. I believe this was before the changes we made. Since now the KNS dictionary validation service overrides the method as follows: public void validateBusinessObject(BusinessObject businessObject, boolean validateRequired) { if (ObjectUtils.isNull(businessObject)) { return; } try { // validate the primitive attributes of the bo validatePrimitivesFromDescriptors(businessObject.getClass().getName(), businessObject, PropertyUtils.getPropertyDescriptors(businessObject.getClass()), "", validateRequired); } catch (RuntimeException e) { LOG.error(String.format("Exception while validating %s", businessObject.getClass().getName()), e); throw e; } } Which is what it did previous to 2.0. thanks, Jerry
            Hide
            jcoltrin Jessica Coltrin (Inactive) added a comment -

            Closing since these items are now in the release notes.

            Show
            jcoltrin Jessica Coltrin (Inactive) added a comment - Closing since these items are now in the release notes.

              People

              • Assignee:
                jkneal Jerry Neal (Inactive)
                Reporter:
                jkeller Jonathan Keller
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: