Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-78433

Single checkbox form field type always submits true when predefinded as true

    Details

      Description

      Description

      When having a predefined value for a single checkbox on a form whether you submitted the form as checked (Yes) or unchecked (No), entires will always save as Yes / true.

      Steps to reproduce

      1. Create a new form
      2. Add a Single Checkbox field and give it a label like "Terms"
      3. Scroll down and "Show More Options" and turn "Predefined Value" on
      4. Save the form and add it to a page using the From portlet.
      5. Submit the form as is with the "Terms" box checked
      6. Unselected the "Terms" box and submit the form for the second time
      7. Navigate to the Forms content menu and "View Entries"

      Results of Testing

      Actual Result: Both entires were submitted as "Yes" or true
      Expected Result: There should be one entry submitted as "Yes" (true) and another submitted as "No" (false)

      No errors

      Branch

      master: The bad code exists in master identical to 7.0.x but you can't reproduce it there following the steps above because the single checkbox is not currently (3070c5c0803bcc725369c4fc637b79bd8c73aa59) an option for forms.
      7.0.x: The regression is caused by LPS-73350 and thus is only reproducible after backporting that LPS to branch.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  1 year, 30 weeks ago

                  Packages

                  Version Package
                  7.0.0 DXP FP47
                  7.0.0 DXP SP8
                  7.0.X
                  7.1.0 M2
                  7.1.X
                  Master