Uploaded image for project: 'Lucee Development'
  1. LDEV-1286

Unexpected behavior with param's required attribute

    Details

    • Type: Bug
    • Status: Deployed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.2.3.5
    • Labels:
      None
    • Sprint:
      July 2017 Sprint

      Description

      The required attribute for cfscript version of <cfparam> defaults the variable to the value of the required attribute instead of requiring the variable to be present. However, omitting the required attribute does require the variable to be present.

      <!--- raises missing required parameter error --->
      <cfparam name="address1" required="true">
      
      // raises missing required parameter error
      param name="address1";
      
      // sets address1 to boolean of true if not present (should raise missing required parameter error)
      param name="address1" required=true;
      
      // sets address1 to string of yes if not present (should raise missing required parameter error)
      param name="address1" required="yes";
      

        Attachments

          Activity

            People

            • Assignee:
              michaeloffner Michael Offner
              Reporter:
              kevin Kevin Koltz
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: