Changeset 17761

Show
Ignore:
Timestamp:
09/29/08 15:43:40 (2 months ago)
Author:
rambo
Message:

forward port r17759

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/midcom.core/midcom/baseclasses/core/dbobject.php

    r17754 r17761  
    669669    function undelete($guids, $type) 
    670670    { 
     671        debug_push_class(__CLASS__, __FUNCTION__); 
     672        debug_print_r("called type '{$type}' for \$guids:", $guids); 
     673        debug_pop(); 
    671674        static $undeleted_size = 0; 
    672675         
     
    680683            ); 
    681684        } 
    682          
     685 
     686        $stats = array(); 
    683687        foreach ($guids as $guid) 
    684688        { 
     
    687691            { 
    688692                // Purged, skip 
     693                debug_push_class(__CLASS__, __FUNCTION__); 
     694                debug_add("Object identified with GUID {$guid} is purged, cannot undelete", MIDCOM_LOG_INFO); 
     695                debug_pop(); 
    689696                continue; 
    690697            } 
     
    706713                } 
    707714            } 
     715            if (!$undeleted) 
     716            { 
     717                debug_push_class(__CLASS__, __FUNCTION__); 
     718                debug_add("Failed to undelete object with GUID {$guid} errstr: " . mgd_errstr(), MIDCOM_LOG_ERROR); 
     719                debug_pop(); 
     720            } 
     721            $stats[$guid] = $undeleted; 
    708722             
    709723            // FIXME: We should only undelete parameters & attachments deleted inside some small window of the main objects delete 
     724            debug_push_class(__CLASS__, __FUNCTION__); 
     725            debug_add("Calling midcom_baseclasses_core_dbobject::undelete_parameters({$guid});"); 
     726            debug_pop(); 
    710727            midcom_baseclasses_core_dbobject::undelete_parameters($guid); 
     728            debug_push_class(__CLASS__, __FUNCTION__); 
     729            debug_add("Calling midcom_baseclasses_core_dbobject::undelete_attachments({$guid});"); 
     730            debug_pop(); 
    711731            midcom_baseclasses_core_dbobject::undelete_attachments($guid); 
    712732 
     
    714734            $children_types = $ref->get_child_objects($object, true); 
    715735             
    716             if (!$children_types
    717             { 
    718                 return true; 
     736            if (empty($children_types)
     737            { 
     738                continue; 
    719739            } 
    720740 
     
    732752            } 
    733753        } 
     754        foreach ($stats as $guid => $bool) 
     755        { 
     756            if (!$bool) 
     757            { 
     758                return false; 
     759            } 
     760        } 
     761        return true; 
    734762    } 
    735763 
     
    774802            } 
    775803        } 
     804        return true; 
    776805    } 
    777806 
     
    822851            } 
    823852        } 
     853        return true; 
    824854    } 
    825855