*** acidfree.module.orig	2011-02-12 13:47:10.000000000 +0100
--- acidfree.module	2011-02-13 12:45:19.000000000 +0100
***************
*** 647,652 ****
--- 647,659 ----
      }
  }
  
+ function _acidfree_check_in_taxonomy ($taxonomy, $value) {
+     foreach ($taxonomy['#options'] as $option) {
+       if (array_key_exists ($value, $option->option)) return TRUE;
+     }
+     return FALSE;
+ }
+ 
  function acidfree_form_alter(&$form, &$form_state, $form_id) {
    // dm($form);
    $q = $_GET['q'];
***************
*** 3435,3444 ****
          $form['taxonomy'] = $form['parent'];
      }
      _acidfree_filter_taxonomy($form['taxonomy'][$vid]);
!     if (variable_get('acidfree_disable_album_selection', true)) {
!         $form['taxonomy'][$vid]['#prefix'] = '<div style="display:none">';
!         $form['taxonomy'][$vid]['#suffix'] = '</div>';
!         $term = taxonomy_get_term($form['parent'][$vid]['#default_value']);
          $form['label'] = array(
              '#type' => 'item',
              '#title' => t('Album'),
--- 3442,3454 ----
          $form['taxonomy'] = $form['parent'];
      }
      _acidfree_filter_taxonomy($form['taxonomy'][$vid]);
!     if (variable_get('acidfree_disable_album_selection', true) &&
! 	_acidfree_check_in_taxonomy ($form['taxonomy'][$vid], $form['parent'][$vid]['#default_value'])) {
! 	$term = taxonomy_get_term($form['parent'][$vid]['#default_value']);
! 	$form['taxonomy'][$vid] = array(
! 		'#type' => 'value',
! 		'#value' => $term->tid,
! 	);
          $form['label'] = array(
              '#type' => 'item',
              '#title' => t('Album'),
