--- faq_ask.module.orig	2009-11-06 14:06:23.000000000 +1030
+++ faq_ask.module	2009-11-06 15:30:55.000000000 +1030
@@ -185,16 +185,33 @@ function faq_ask_form_alter(&$form, $for
 
   // Make sure we know we came from here.
   $form['faq_ask'] = array('#type' => 'value', '#value' => TRUE);
-  $form['#submit'][] = 'faq_ask_submit';
 }
 
-function faq_ask_submit($form, &$form_state) {
+/**
+ * Implementation of hook_nodeapi().
+ *  Send expert emails
+ */
+function faq_ask_nodeapi(&$node, $op) {
+  if ($node->type == 'faq') {
+    switch ($op) {
+      case 'insert':
+      case 'update':
+        faq_ask_mail_experts($node);
+        break;
+    }
+  }
+}
+
+/**
+ * Experts mail handler.
+ */
+function faq_ask_mail_experts($node) {
   // Use only the first term entered in the correct vocabulary.
   $vocabs = variable_get('faq_ask_vocabularies', 0);
-  if (isset($form_state['values']['taxonomy']['tags'])) {
-    foreach ($form_state['values']['taxonomy']['tags'] as $vid => $term_name) {
+  if (isset($node->taxonomy)) {
+    foreach ($node->taxonomy as $vid => $tid) {
       if (in_array($vid, $vocabs)) {
-        $term = taxonomy_get_term_by_name($term_name);
+        $term = taxonomy_get_term($tid);
         $category = $term->tid;
       }
     }
