You are here

function shurly_set_error in ShURLy 6

Set an validation error We don't call form_set_error() directly because we don't want to be calling drupal_set_message() during API calls

3 calls to shurly_set_error()
shurly_errors_to_form in ./shurly.module
Set errors on form items (for use with form API)
shurly_get_errors in ./shurly.module
Get an array of errors (for delivering errors through web services)
shurly_validate_long in ./shurly.module
Validate a long URL

File

./shurly.module, line 899
description http://www.youtube.com/watch?v=Qo7qoonzTCE

Code

function shurly_set_error($message = NULL, $field = NULL) {
  static $errors = array();
  if ($message) {
    $errors[] = array(
      'message' => $message,
      'field' => $field,
    );
  }
  return $errors;
}