Changeset 1054 for devel/profile

Show
Ignore:
Timestamp:
04/02/07 12:05:56 (2 years ago)
Author:
ben
Message:

Profile edit fix.

Files:

Legend:

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

    r1030 r1054  
    33//    ELGG profile edit page 
    44 
    5 global $profile_name, $profile_id
     5global $profile_name, $profile_id, $messages
    66 
    77// Run includes 
     
    8181            $value = trim($value); 
    8282           
    83             if ($value != "") { 
     83            if (!empty($value)) { 
    8484                //TODO get rid of variable duplication here. (Penny) 
    8585                if (!empty($data['profile:details'][$field]->invisible)) { 
     
    116116                        } 
    117117                    } 
    118                     if ($fname == $field && $frequired == true) { 
    119                         $requiredmissing[] = sprintf(__gettext("%s (in category %s)"),$flabel,$fcat); 
     118                    if ($fname == $field) { 
     119                        if ($frequired == true) { 
     120                            $requiredmissing[] = sprintf(__gettext("%s (in category %s)"),$flabel,$fcat); 
     121                        } else { 
     122                            delete_records('profile_data','owner',$page_owner,'name',$fname); 
     123                        } 
    120124                    } 
    121125                } 
    122                 delete_records('profile_data','owner',$page_owner,'name',$fname); 
    123                  
    124126            } 
    125127        }