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

beforeValidate CoPersonRole sets incorrect message

    XMLWordPrintable

Details

    Description

      The beforeValidate() method for the CoPersonRole model is currently

       public function beforeValidate($options = array()) {    if(!empty($_REQUEST['data'][$this->alias])) {      
      foreach ($_REQUEST['data'][$this->alias] as $field => $value) {
              if(strpos($field, '-required') !== false) {
                // Just found a required field. We will update the rule accordingly
                // required means that the field should be non-empty and present
                // $ea['required'] = !($ea['allow_empty'] && $vv_allow_empty_cou);
                $field = explode('-', $field)[0];
                $this->validate[$field]['content']['required'] = true;
                $this->validate[$field]['content']['allowEmpty'] = false;
                $this->validate[$field]['content']['message'] = "COU is required";
              }
            }
          }    return parent::beforeValidate($options);
        }

      Note that the message key is set to "COU is required" for all fields and not just the COU field.

      Attachments

        Issue Links

          Activity

            People

              arlen.johnson@at.internet2.edu Arlen Johnson
              scott.koranda@at.internet2.edu Scott Koranda
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: