Index: profile_csv.module =================================================================== --- profile_csv.module (revision 1771) +++ profile_csv.module (working copy) @@ -89,26 +89,28 @@ '#collapsed' => true, ); - $result = db_query("SELECT pf.fid, pf.name, pf.title, pf.category FROM {profile_fields} pf ORDER BY pf.category, pf.weight, pf.title"); - while ($row = db_fetch_object($result)) { - $fld = PROFILE_CSV_PARAM . 'profile_' . $row->fid; - - if (!isset($form[$set][$row->category])) { - $form[$set][$row->category] = array( - '#type' => 'fieldset', - '#title' => $row->category, - '#collapsible' => true, - ); - } - - $form[$set][$row->category][$fld] = array( - '#type' => 'checkbox', - '#title' => $row->title, - '#return_value' => 1, - '#default_value' => variable_get($fld, 0), - ); - } - return system_settings_form($form); + if(module_exists('profile')) { + $result = db_query("SELECT pf.fid, pf.name, pf.title, pf.category FROM {profile_fields} pf ORDER BY pf.category, pf.weight, pf.title"); + while ($row = db_fetch_object($result)) { + $fld = PROFILE_CSV_PARAM . 'profile_' . $row->fid; + + if (!isset($form[$set][$row->category])) { + $form[$set][$row->category] = array( + '#type' => 'fieldset', + '#title' => $row->category, + '#collapsible' => true, + ); + } + + $form[$set][$row->category][$fld] = array( + '#type' => 'checkbox', + '#title' => $row->title, + '#return_value' => 1, + '#default_value' => variable_get($fld, 0), + ); + } + } + return system_settings_form($form); } function profile_csv_perm() { @@ -202,7 +204,10 @@ function _profile_csv_format_user($uid = 0) { $user_data = _profile_csv_get_user($uid); - $profile_data = _profile_csv_get_profile($uid,$user_data['data']); + $profile_data = array(); + if(module_exists('profile')) { + $profile_data = _profile_csv_get_profile($uid,$user_data['data']); + } unset($user_data['data']); $info = array_merge($user_data, $profile_data); //all of the valid fields in ['data'] should have been picked out in _profile_csv_get_profile, so unset it @@ -278,4 +283,4 @@ } return implode(",", $row) ."\n"; -} \ No newline at end of file +}