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

Binding path for PrerequisiteConstraints defined in data dictionary wrong on reload

    Details

    • Type: Bug Fix
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.3.2, 2.4
    • Fix Version/s: 2.5
    • Security Level: Public (Public: Anyone can view)
    • Labels:
      None
    • Rice Module:
      KRAD
    • KRAD Feature Area:
      Data Dictionary
    • Application Requirement:
      KS
    • Sprint:
      Core 2.5.0-m7 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

      Prerequisite constraints defined in a data dictionary are broken when the page (with an input that references the attribute) is reloaded, either by hitting the browser reload button or navigating away and then returning to the page. Not sure if it's relevant or not, but the page in question here is part of a maintenance view.

      Here's the specific scenario. In this DD def ...

      https://svn.kuali.org/repos/student/enrollment/ks-api/trunk/ks-enroll-api/src/main/resources/ks-CourseInfo-dictionary.xml

      ... if I modify the CourseInfo.pilotCourse bean like ...

      <bean id="CourseInfo.pilotCourse" parent="CourseInfo.pilotCourse-parent"/>
      <bean id="CourseInfo.pilotCourse-parent" abstract="true" parent="CourseInfo.pilotCourse-generated">
           <property name="dependencyConstraints">
                <list>
                     <bean parent="PrerequisiteConstraint" p:propertyName="courseInfo.endTerm">
                          <property name="messageKey" value="Some key"/>
      ...
      

      It works as expected the first time the page is loaded, but if the page is reloaded a JS error is generated in krad.utility.js#getAttributeId(elementId). I believe this is because PrerequisiteConstraint#getPropertyAdjustedBindingPath(String propertyPath) prepends the bindingPath to propertyPath on page reload. So, the binding property name gets set to ...

      document.newMaintainableObject.dataObject.courseInfo.endTerm
      .... then ...
      document.newMaintainableObject.dataObject.document.newMaintainableObject.dataObject.courseInfo.endTerm
      ... etc.

      This isn't a problem when the same constraints are configured directly in the input definition.

      StR:

      • Add a prerequisite constraint to the DD and reference the attribute from an input field (perhaps on a maintenace doc)
      • Load the page
      • Reload the page either with the refresh button or navigating away from the page and back
        • Expected: The constraint is functional
        • Actual: As JS error is thrown and the page is initialized propertly

        Attachments

          Issue Links

            Activity

            No work has yet been logged on this issue.

              People

              • Assignee:
                jruch Jeff Ruch
                Reporter:
                lsymms Larry Symms
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: