original_string: public function validation($data, $files) {
          $errors = parent::validation($data, $files);
  
          if ($files = $this->get_draft_files('rolepreset')) {
              /** @var stored_file $file */
              $file = reset($files);
              $xml = $file->get_content();
              if (!core_role_preset::is_valid_preset($xml)) {
                  $errors['rolepreset'] = get_string('invalidpresetfile', 'core_role');
              }
          }
  
          return $errors;
      }
code: public function validation($data, $files) {
          $errors = parent::validation($data, $files);
  
          if ($files = $this->get_draft_files('rolepreset')) {
              /** @var stored_file $file */
              $file = reset($files);
              $xml = $file->get_content();
              if (!core_role_preset::is_valid_preset($xml)) {
                  $errors['rolepreset'] = get_string('invalidpresetfile', 'core_role');
              }
          }
  
          return $errors;
      }
code_tokens: public function validation ( $ data , $ files ) { $ errors = parent :: validation ( $ data , $ files ) ; if ( $ files = $ this -> get_draft_files ( 'rolepreset' ) ) { /** @var stored_file $file */ $ file = reset ( $ files ) ; $ xml = $ file -> get_content ( ) ; if ( ! core_role_preset :: is_valid_preset ( $ xml ) ) { $ errors [ 'rolepreset' ] = get_string ( 'invalidpresetfile' , 'core_role' ) ; } } return $ errors ; }
docstring: Validate this form.
  
  @param array $data submitted data
  @param array $files not used
  @return array errors
docstring_tokens: Validate this form .