Index: acidfree.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/acidfree/acidfree.module,v
retrieving revision 1.147.2.41
diff -u -d -r1.147.2.41 acidfree.module
--- acidfree.module	14 Feb 2011 20:50:10 -0000	1.147.2.41
+++ acidfree.module	14 Feb 2011 20:50:39 -0000
@@ -649,18 +649,18 @@
 
 function _acidfree_check_in_taxonomy ($taxonomy, $value) {
     foreach ($taxonomy['#options'] as $option) {
-      if (array_key_exists ($value, $option->option)) return TRUE;
+        if (isset($option) && is_object($option) &&
+           array_key_exists ($value, $option->option)) return TRUE;
     }
     return FALSE;
 }
 
 function acidfree_form_alter(&$form, &$form_state, $form_id) {
-  // dm($form);
-  $q = $_GET['q'];
   $nodes_to_check = array();
   switch ($form_id) {
     case 'acidfree_node_form':
-        _acidfree_node_form_alter($form, $form_state);
+        $pid = array_pop(explode('/',$_GET['q']));
+        _acidfree_node_form_alter($form, $form_state, $pid);
         break;
     case 'system_modules':
       break;
@@ -3448,7 +3448,8 @@
     }
 }
 
-function _acidfree_node_form_alter(&$form, &$form_state) {
+
+function _acidfree_node_form_alter(&$form, &$form_state, $pid) {
     $vid = acidfree_get_vocab_id();
     if (isset($form['taxonomy'])) {
         $form['taxonomy'][$vid] = $form['parent'][$vid];
@@ -3460,9 +3461,16 @@
         }
         $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'])) {
+
+    // If we are adding a new album, but we already have a parent and
+    // the admin has chosen to suppress the album selector
+    // hide the taxonomy.
+    if (!(isset($form['#node']->nid)) && isset($pid) &&
+        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',
