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

            Hide
            kbtaylor Kristina Taylor (Inactive) added a comment -

            Larry Symms, is this still occurring? I recall fixing something similar to this bug.

            Show
            kbtaylor Kristina Taylor (Inactive) added a comment - Larry Symms , is this still occurring? I recall fixing something similar to this bug.
            Hide
            sudduth Glenn Sudduth (Inactive) added a comment -

            Not sure about this particular issue, but yesterday I was getting a very similar behavior/breakage with a case constraint defined in the DD (w/Rice 2.4.1).
            (I'll be doing some additional testing today and will most likely file a bug)

            Show
            sudduth Glenn Sudduth (Inactive) added a comment - Not sure about this particular issue, but yesterday I was getting a very similar behavior/breakage with a case constraint defined in the DD (w/Rice 2.4.1). (I'll be doing some additional testing today and will most likely file a bug)
            Hide
            lsymms Larry Symms added a comment -

            Need to verify this is still happening for this to get attention in 2.5. Option 1 test in ks's rice-upgrade branch. Option 2 pull down rice and try to duplicate.

            Show
            lsymms Larry Symms added a comment - Need to verify this is still happening for this to get attention in 2.5. Option 1 test in ks's rice-upgrade branch. Option 2 pull down rice and try to duplicate.
            Hide
            jruch Jeff Ruch added a comment -

            This problem is similar to KULRICE-13096. Both are caused by the bindingPath being applied multiple times.

            Show
            jruch Jeff Ruch added a comment - This problem is similar to KULRICE-13096 . Both are caused by the bindingPath being applied multiple times.
            Hide
            jruch Jeff Ruch added a comment -

            Completed fix and committed. See KULRICE-13096 for details.

            Show
            jruch Jeff Ruch added a comment - Completed fix and committed. See KULRICE-13096 for details.

              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: