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

MustOccurConstraint validation not working correctly

    Details

    • Type: Bug Fix
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 2.5
    • Component/s: Development
    • Security Level: Public (Public: Anyone can view)
    • Labels:
      None
    • Rice Module:
      KRAD
    • Sprint:
      2.5.0-m2 Sprint 3
    • KAI Review Status:
      Not Required
    • KTI Review Status:
      Not Required
    • Code Review Status:
      Not Required
    • Include in Release Notes?:
      Yes

      Description

      To see the issue, go to Validation --> Must Occur Constraint --> Example 1 (similar issues with Example 2 and 3)

      The constraint text says "Field 1A; OR Field 2A with Field 2B must occur when this field [Field with MustOccurConstraint] has a value"

      However, it allows any two fields to satisfy the constraint. ex - if you have 1A and 2B populated it does not throw an error when the Field with MustOccurConstraint is populated.

                      <property name="mustOccurConstraints">
                        <list>
                          <bean parent="MustOccurConstraint">
                            <property name="min" value="2"/>
                            <property name="max" value="2"/>
                            <property name="prerequisiteConstraints">
                              <list>
                                <bean parent="PrerequisiteConstraint" p:propertyName="inputField2"/>
                                <bean parent="PrerequisiteConstraint" p:propertyName="inputField3"/>
                              </list>
                            </property>
                          </bean>
                        </list>
                      </property>
      

        Attachments

          Issue Links

            Activity

            Hide
            cniesen Claus Niesen added a comment -

            What you seeing here is that the first condition matches (field 1A has a value). At this point, because of the OR, it doesn't care if fields 2A and/or 2B have values or not.

            Show
            cniesen Claus Niesen added a comment - What you seeing here is that the first condition matches (field 1A has a value). At this point, because of the OR, it doesn't care if fields 2A and/or 2B have values or not.
            Hide
            cniesen Claus Niesen added a comment -

            Just to make sure let's change the ORs to AND/ORs. Hopefully this will clear things up for everybody

            Field 1A AND/OR Field 2A with Field 2B must occur when this field ___ has a value

            Show
            cniesen Claus Niesen added a comment - Just to make sure let's change the ORs to AND/ORs. Hopefully this will clear things up for everybody Field 1A AND/OR Field 2A with Field 2B must occur when this field ___ has a value
            Hide
            shahess Shannon Hess added a comment - - edited

            After you explained it, it made sense to me. I think the confusing part is actually the "Field 2A with Field 2B". The "with" made me assume that if you had Field 2A you also had to have Field 2B. So both or nothing. But I'm not sure how that could be better clarified. Your sentence saying because of the OR, it doesn't care if fields 2A and/or 2B have values or not made it really clear for me though. (Cause that's how code would work too)

            Show
            shahess Shannon Hess added a comment - - edited After you explained it, it made sense to me. I think the confusing part is actually the "Field 2A with Field 2B". The "with" made me assume that if you had Field 2A you also had to have Field 2B. So both or nothing. But I'm not sure how that could be better clarified. Your sentence saying because of the OR, it doesn't care if fields 2A and/or 2B have values or not made it really clear for me though. (Cause that's how code would work too)

              People

              • Assignee:
                cniesen Claus Niesen
                Reporter:
                shahess Shannon Hess
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 5 minutes
                  5m
                  Remaining:
                  Remaining Estimate - 5 minutes
                  5m
                  Logged:
                  Time Spent - Not Specified
                  Not Specified