Index: fckeditor.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/fckeditor/fckeditor.module,v retrieving revision 1.20.2.39 diff -u -r1.20.2.39 fckeditor.module --- fckeditor.module 11 Jul 2008 07:58:30 -0000 1.20.2.39 +++ fckeditor.module 12 Aug 2008 18:53:10 -0000 @@ -577,10 +577,10 @@ /** * Load all profiles. Just load one profile if $name is passed in. */ -function fckeditor_profile_load($name = '') { +function fckeditor_profile_load($name = '', $clear = FALSE) { static $profiles = array(); - if (!$profiles) { + if ((!$profiles) || ($clear === TRUE)) { $roles = user_roles(); $result = db_query('SELECT * FROM {fckeditor_settings}'); while ($data = db_fetch_object($result)) { @@ -1203,9 +1203,10 @@ /** * sort roles according to precedence settings. previously sorted roles are followed by latest added roles. */ -function fckeditor_sorted_roles() { +function fckeditor_sorted_roles($clear = FALSE) { static $order; - if (isset($order)) { + + if (isset($order) && ($clear !== TRUE)) { return $order; } $order = array(); @@ -1851,13 +1852,16 @@ return $status; } -function fckeditor_user_get_profile($user) { +function fckeditor_user_get_profile($user, $clear = FALSE) { static $profile_name; + if ($clear ===TRUE ) { + $profile_name = array(); + } // Since fckeditor_profile_load() makes a db hit, only call it when we're pretty sure // we're gonna render fckeditor. if (!isset($profile_name[$user->uid])) { - $sorted_roles = fckeditor_sorted_roles(); + $sorted_roles = fckeditor_sorted_roles( $clear ); foreach ($sorted_roles as $rid => $name) { if (isset($user->roles[$rid])) { break; @@ -1873,7 +1877,7 @@ } if (isset($profile_name[$user->uid]) && $profile_name[$user->uid]) { - $profile = fckeditor_profile_load($profile_name[$user->uid]); + $profile = fckeditor_profile_load($profile_name[$user->uid], $clear); return $profile; }