When clicking any term name from taxonomy tree, the form rebuild is ran.
All validation handlers are called even if they are not necessary, considering that we are just switching the term that is viewed.

As an example consider that we have a required field which is not completed (data being populated with some import scripts). Once we entered a term we cannot switch to another, until that required field is not empty.

Update1:
Same issue when you are trying to search another term and you already have a term opened with a required field that is empty.

Comments

Cracu’s picture

Please test and review this patch.

Instead of:

$form['load-tid-submit'] = array(
    '#type' => 'submit',
    '#value' => 'load term',
    '#submit' => array('taxonomy_manager_load_tid_submit'),
    '#ajax' => array(
      'callback' => 'taxonomy_manager_term_data_form_ajax_callback',
      'method' => 'replaceWith',
      'event' => 'click',
      'wrapper' => 'taxonomy-term-data-replace',
    ),
    '#suffix' => '</div>',
  );

I used:

$form['load-tid-submit'] = array(
    '#type' => 'submit',
    '#value' => 'load term',
    '#submit' => array('taxonomy_manager_load_tid_submit'),
    '#limit_validation_errors' => array(
      array('load-tid'),
    ),
    '#ajax' => array(
      'callback' => 'taxonomy_manager_term_data_form_ajax_callback',
      'method' => 'replaceWith',
      'event' => 'click',
      'wrapper' => 'taxonomy-term-data-replace',
    ),
    '#suffix' => '</div>',
  );
Cracu’s picture

Issue summary:View changes

Corrected description.

Cracu’s picture

The same problem occurs when you are trying to search for a new term while having a term already opened and a required field is empty.

Adding another patch to fix both problems.

Cracu’s picture

Additional fixes added for particular scenarios.

Cracu’s picture

Issue summary:View changes

more issues detected.

interdruper’s picture

Issue summary:View changes
Status:Active» Reviewed & tested by the community

Patch #2047517-3: Validation is called when terms are selected in tree. worked for me.
The bug was specially annoying when reviewing taxonomy terms...