Changeset 17759
- Timestamp:
- 09/29/08 15:36:00 (2 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/MidCOM_2_8/midcom.core/midcom/baseclasses/core/dbobject.php
r17755 r17759 669 669 function undelete($guids, $type) 670 670 { 671 debug_push_class(__CLASS__, __FUNCTION__); 672 debug_print_r("called type '{$type}' for \$guids:", $guids); 673 debug_pop(); 671 674 static $undeleted_size = 0; 672 675 … … 680 683 ); 681 684 } 682 685 686 $stats = array(); 683 687 foreach ($guids as $guid) 684 688 { … … 687 691 { 688 692 // 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(); 689 696 continue; 690 697 } … … 706 713 } 707 714 } 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; 708 722 709 723 // 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(); 710 727 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(); 711 731 midcom_baseclasses_core_dbobject::undelete_attachments($guid); 712 732 … … 714 734 $children_types = $ref->get_child_objects($object, true); 715 735 716 if ( !$children_types)717 { 718 return true;736 if (empty($children_types)) 737 { 738 continue; 719 739 } 720 740 … … 732 752 } 733 753 } 754 foreach ($stats as $guid => $bool) 755 { 756 if (!$bool) 757 { 758 return false; 759 } 760 } 761 return true; 734 762 } 735 763 … … 774 802 } 775 803 } 804 return true; 776 805 } 777 806 … … 822 851 } 823 852 } 853 return true; 824 854 } 825 855
