You are here

function views_bulk_operations_script_action in Views Bulk Operations (VBO) 7.3

Same name and namespace in other branches
  1. 6.3 script.action.inc \views_bulk_operations_script_action()
  2. 6 actions/script.action.inc \views_bulk_operations_script_action()

File

actions/script.action.inc, line 19

Code

function views_bulk_operations_script_action($entity, $context) {
  $return = eval($context['script']);
  if ($return === FALSE) {
    $msg = 'Error in script.';
    $arg = array();
    $error = error_get_last();
    if ($error) {
      $msg = '!err in script: !msg in line \'%line\'.';
      $arg = array(
        '!msg' => $error['message'],
        '%line' => _views_bulk_operations_script_action_error_line($context['script'], $error['line']),
        '!err' => _views_bulk_operations_script_action_error_type($error['type']),
      );
    }
    drupal_set_message(t($msg, $arg), 'error', FALSE);
    watchdog('actions', $msg, $arg, WATCHDOG_ERROR);
  }
}