You are here

function _patterns_io_import_validate_content in Patterns 7

Same name and namespace in other branches
  1. 7.2 includes/io/import.inc \_patterns_io_import_validate_content()
1 call to _patterns_io_import_validate_content()
patterns_io_import_file in includes/io/import.inc

File

includes/io/import.inc, line 27
Importing Patterns from a file or using an URL.

Code

function _patterns_io_import_validate_content($pattern) {
  $patternscan = patterns_scan_pattern($pattern);
  if (!_patterns_scan_validate_patternscan($patternscan)) {
    $errors_on_scan = _patterns_scan_analyze_patternscan($patternscan);
    drupal_set_message(t('Error parsing the YAML file: ' . implode(', ', $errors_on_scan)), 'error');
    return FALSE;
  }
  return TRUE;
}