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 Bug Fix
    • Status: Closed Closed
    • Priority: Blocker 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
    • Similar issues:
      KULRICE-11977Collection add line and line item enter key support implementation
      KULRICE-13207AFT Failure Tables and Collections Selected collection path was not set for collection action
      KULRICE-12670Input field not rendering on collection add line item
      KULRICE-11909Collection add not working ( collection disappears on add)
      KULRICE-8240Major issues with add line functionality and collection refresh
      KULRICE-13052TableCollection addDialog not being bound properly to the collection
      KULRICE-124002.4.0 CDT: Sorting not working on add line in collection
      KULRICE-5345Add ability to identify new lines in collections
      KULRICE-8951Property editors not getting picked up on add line and collection line items
      KULRICE-12252Table line select field does not include object binding path set on the group
    • 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.

        Issue Links

          Activity

          Hide
          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
          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
          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
          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
          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
          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
          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
          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
          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
          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
          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
          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
          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
          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
          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
          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
          Jessica Coltrin (Inactive) added a comment -

          Closing since these items are now in the release notes.

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

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Structure Helper Panel