You are here

function apachesolr_attachments_settings_validate in Apache Solr Attachments 7

Same name and namespace in other branches
  1. 6.3 apachesolr_attachments.admin.inc \apachesolr_attachments_settings_validate()
  2. 6 apachesolr_attachments.admin.inc \apachesolr_attachments_settings_validate()
  3. 6.2 apachesolr_attachments.admin.inc \apachesolr_attachments_settings_validate()

Form validation for the Apache Solr Attachments settings form.

See also

apachesolr_attachments_settings()

1 string reference to 'apachesolr_attachments_settings_validate'
apachesolr_attachments_settings in ./apachesolr_attachments.admin.inc
Displays the Attachment Settings Form.

File

./apachesolr_attachments.admin.inc, line 84
Provides a file attachment search implementation for use with the Apache Solr module

Code

function apachesolr_attachments_settings_validate($form, &$form_state) {
  if ($form_state['values']['apachesolr_attachments_extract_using'] == 'tika') {
    $path = realpath($form_state['values']['apachesolr_attachments_tika_path']);
    if (!file_exists($path . '/' . $form_state['values']['apachesolr_attachments_tika_jar'])) {
      form_set_error('apachesolr_attachments_tika_path', t('Tika jar file not found at this path.'));
    }
  }
  if (!is_numeric($form_state['values']['apachesolr_attachments_filesize_limit'])) {
    form_set_error('apachesolr_attachments_filesize_limit', t('File size limit must be a number (in bytes).'));
  }
}