Changeset 341 for devel

Show
Ignore:
Timestamp:
05/13/06 14:27:24 (3 years ago)
Author:
ben
Message:

Empty profile fields are now correctly initialised (using the default access level etc); previously they were attempting to get details from a database query that returned false.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • devel/profile/profile.class.php

    r339 r341  
    269269        global $page_owner; 
    270270        global $data; 
     271        global $CFG; 
    271272 
    272273        $run_result = ''; 
     
    277278             
    278279        if (!isset($data['profile:preload'][$flabel])) { 
    279             $value = get_record('profile_data','name',$fname,'owner',$page_owner); 
    280          
     280            if (!$value = get_record('profile_data','name',$fname,'owner',$page_owner)) { 
     281                $value = ""; 
     282                $value->value = ""; 
     283                $value->access = $CFG->default_access; 
     284            } 
    281285        } else { 
    282286            $value = ""; 
    283287            $value->value = $data['profile:preload'][$fname]; 
    284             $value->access = "PUBLIC"
     288            $value->access = $CFG->default_access
    285289             
    286290        }