Uploaded image for project: 'COmanage'
  1. COmanage
  2. CO-281

Review use of required vs allowEmpty

    XMLWordPrintable

Details

    Description

      It's not clear the Registry consistently follows Cake's definition of required vs allowEmpty. Consider data being submitted as

      $data['Model']['field'] = "value";

      In Cake, "required => true" means 'field' must be present in $data['Model']. "allowEmpty => false" means "value" must be provided.

      In Registry, "required" means "SQL NOT NULL".

      Review $validates in each model to ensure the correct usage is intended. ie: If a field is NOT NULL in the schema, then allowEmpty should be set to false. There are few, if any, use cases for required to be set.

      When cleaning this up, see if any COmanage code is directly inspecting $validates.

      Attachments

        Issue Links

          Activity

            People

              benn.oshrin@at.internet2.edu Benn Oshrin (internet2.edu)
              benn.oshrin@at.internet2.edu Benn Oshrin (internet2.edu)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Smart Checklist