You are here

function term_merge_duplicates_fieldset_validate in Term Merge 7

FAPI element validation callback.

Validate fieldset of a 'term_merge_duplicates_form' form, if any duplicate has been selected for merging, it makes sure the trunk term has been selected. We can't allow merging without knowing the explicit trunk term.

1 string reference to 'term_merge_duplicates_fieldset_validate'
term_merge_duplicates_form in ./term_merge.pages.inc
Generate 'term_merge_duplicates_form'.

File

./term_merge.pages.inc, line 691
Menu page callbacks for Term Merge module.

Code

function term_merge_duplicates_fieldset_validate($element, &$form_state, $form) {
  if (!empty($element['duplicates']['#value']) && !is_numeric($element['trunk_tid']['#value'])) {
    form_error($element, t('Please, choose %trunk_tid_label for the group %group_label', array(
      '%trunk_tid_label' => $element['trunk_tid']['#title'],
      '%group_label' => $element['#title'],
    )));
  }
}