You are here

function fillpdf_form_import_form_validate in FillPDF 7

Same name and namespace in other branches
  1. 6 fillpdf.admin.inc \fillpdf_form_import_form_validate()
  2. 7.2 fillpdf.admin.inc \fillpdf_form_import_form_validate()

Check the syntax of the code the user is trying to import.

File

./fillpdf.admin.inc, line 740
Allows mappings of PDFs to site content.

Code

function fillpdf_form_import_form_validate($form, &$form_state) {
  $mappings = json_decode($form_state['values']['code'], TRUE);
  if (empty($mappings) || !is_array($mappings)) {
    form_set_error('code', t('There was a problem processing your FillPDF Field Mappings code. Please do a fresh export from the source and try pasting it again.'));
  }
  else {
    $form_state['values']['mappings'] = $mappings;
  }
}