Index: trunk/kernel/units/user_profile/user_profile_tp.php =================================================================== diff -u -N -r8634 -r8636 --- trunk/kernel/units/user_profile/user_profile_tp.php (.../user_profile_tp.php) (revision 8634) +++ trunk/kernel/units/user_profile/user_profile_tp.php (.../user_profile_tp.php) (revision 8636) @@ -57,11 +57,23 @@ $sql = 'SELECT VariableValue, VariableName FROM '.TABLE_PREFIX.'PersistantSessionData - WHERE (PortalUserId = '.$user_id.') AND (LENGTH(VariableValue) < 10)'; + WHERE (PortalUserId = '.$user_id.')'; $cached_vars = $this->Conn->GetCol($sql, 'VariableName'); } - return isset($cached_vars[$var_name]) ? $cached_vars[$var_name] : false; + if (isset($cached_vars[$var_name])) { + // get variable value from persistent session + return $cached_vars[$var_name]; + } + else { + // not found in persistent session -> get default value from config variable with same name + $config_value = $this->Application->ConfigValue($var_name); + if ($config_value !== false) { + return $config_value; + } + } + + return false; } /** @@ -122,6 +134,21 @@ return $counter < $this->ProfileFieldCount(); } + + /** + * Because of persistant session table doesn't have ids, we use user id as id for each record + * + * @param Array $params + * @return Array (id,field) + * @access private + */ + function prepareInputName($params) + { + list ($id, $field) = parent::prepareInputName($params); + $id = $this->Application->RecallVar('user_id'); + + return Array($id, $field); + } } ?> \ No newline at end of file