--- tinymce.module.orig Sun May 28 14:15:00 2006 +++ tinymce.module Sun May 28 20:36:06 2006 @@ -85,7 +85,8 @@ function tinymce_process_textarea($eleme // Since tinymce_config() makes a db hit, only call it when we're pretty sure // we're gonna render tinymce. if (!$profile_name) { - $profile_name = db_result(db_query('SELECT s.name FROM {tinymce_settings} s INNER JOIN {tinymce_role} r ON r.name = s.name WHERE r.rid IN (%s)', implode(',', array_keys($user->roles)))); + $profile_row = db_fetch_object(db_query('SELECT * FROM {tinymce_role} WHERE rid IN (%s) ORDER BY rid DESC', implode(',', array_keys($user->roles)))); + $profile_name = $profile_row->name; } $profile = tinymce_profile_load($profile_name); $init = tinymce_config($profile); @@ -1100,9 +1101,9 @@ function _tinymce_page_match($edit) { } function tinymce_user_get_profile($account) { - $profile_name = db_result(db_query('SELECT s.name FROM {tinymce_settings} s INNER JOIN {tinymce_role} r ON r.name = s.name WHERE r.rid IN (%s)', implode(',', array_keys($account->roles)))); - if ($profile_name){ - return tinymce_profile_load($profile_name); + $profile_row = db_fetch_object(db_query('SELECT * FROM {tinymce_role} WHERE rid IN (%s) ORDER BY rid DESC', implode(',', array_keys($account->roles)))); + if ($profile_row){ + return tinymce_profile_load($profile_row->name); } else { return FALSE;