original_string: public function validation($data, $files) {
          $errors = parent::validation($data, $files);
          if (empty($data['fulldelete']) && empty($data['newparent'])) {
              // When they have chosen the move option, they must specify a destination.
              $errors['newparent'] = get_string('required');
          }
  
          if ($data['sure'] !== md5(serialize($this->coursecat))) {
              $errors['categorylabel'] = get_string('categorymodifiedcancel');
          }
  
          return $errors;
      }
code: public function validation($data, $files) {
          $errors = parent::validation($data, $files);
          if (empty($data['fulldelete']) && empty($data['newparent'])) {
              // When they have chosen the move option, they must specify a destination.
              $errors['newparent'] = get_string('required');
          }
  
          if ($data['sure'] !== md5(serialize($this->coursecat))) {
              $errors['categorylabel'] = get_string('categorymodifiedcancel');
          }
  
          return $errors;
      }
code_tokens: public function validation ( $ data , $ files ) { $ errors = parent :: validation ( $ data , $ files ) ; if ( empty ( $ data [ 'fulldelete' ] ) && empty ( $ data [ 'newparent' ] ) ) { // When they have chosen the move option, they must specify a destination. $ errors [ 'newparent' ] = get_string ( 'required' ) ; } if ( $ data [ 'sure' ] !== md5 ( serialize ( $ this -> coursecat ) ) ) { $ errors [ 'categorylabel' ] = get_string ( 'categorymodifiedcancel' ) ; } return $ errors ; }
docstring: Perform some extra moodle validation.
  
  @param array $data
  @param array $files
  @return array An array of errors.
docstring_tokens: Perform some extra moodle validation .