Changeset 16091

Show
Ignore:
Timestamp:
04/15/08 14:31:32 (6 months ago)
Author:
rambo
Message:

forward port r16090

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/midcom.helper.replicator/exporter/staging2live.php

    r16087 r16091  
    188188    function _check_approval(&$object) 
    189189    { 
     190        static $parent_check_stack = array(); 
    190191        debug_push_class(__CLASS__, __FUNCTION__); 
    191192        debug_add("Called for {$object->guid}"); 
     
    244245            // Check the parent also, as that may be unapproved 
    245246            $parent = $object->get_parent(); 
    246             if ($parent) 
    247             { 
     247            if (   is_object($parent) 
     248                && isset($parent->guid) 
     249                && !empty($parent->guid)) 
     250            { 
     251                array_push($parent_check_stack, $object->guid); 
    248252                $this->exportability[$object->guid] = $this->is_exportable($parent, false); 
    249  
     253                array_pop($parent_check_stack); 
    250254                if (!$this->exportability[$object->guid]) 
    251255                { 
    252256                    // TODO: Uimessage, but how to give only one ?? 
    253257                    $GLOBALS['midcom_helper_replicator_logger']->log_object($object, 'Parent not approved, skipping'); 
     258                    if (empty($parent_check_stack)) 
     259                    { 
     260                        // Empty stack means we're  not inside parent recursion, thus we can raise an UIMessage 
     261                        $_MIDCOM->load_library('midcom.helper.reflector'); 
     262                        $ref = new midcom_helper_reflector($object); 
     263                        $_MIDCOM->uimessages->add 
     264                        ( 
     265                            $this->_l10n->get('midcom.helper.replicator'), 
     266                            sprintf 
     267                            ( 
     268                                $this->_l10n->get('%s %s could not be exported for replication because one of its parents is not approved'),  
     269                                $ref->get_class_label(),  
     270                                $ref->get_object_label($object) 
     271                            ), 
     272                            'warning' 
     273                        ); 
     274                    } 
    254275                } 
    255276            } 
  • trunk/midcom/midcom.helper.replicator/locale/default.en.txt

    r15833 r16091  
    5656---STRINGEND 
    5757 
     58---STRING http post transport 
     59HTTP POST transport 
     60---STRINGEND 
     61 
    5862---STRING imported 
    5963Imported to database 
     
    6973 
    7074---STRING mirroring subscription 
    71 Mirror 
     75Mirroring Subscription 
    7276---STRINGEND 
    7377 
     
    8892---STRINGEND 
    8993 
     94---STRING replication queue %s cannot be written by Apache user 
     95Replication queue %s cannot be written by Apache user 
     96---STRINGEND 
     97 
    9098---STRING replication queue %s does not exist 
    9199Replication queue %s does not exist 
    92 ---STRINGEND 
    93  
    94 ---STRING replication queue %s cannot be written by Apache user 
    95 Replication queue %s cannot be written by Apache user 
    96100---STRINGEND 
    97101 
     
    106110---STRING staging2live subscription 
    107111Staging/live 
     112---STRINGEND 
     113 
     114---STRING staging2live subscription with type filter 
     115Staging2live subscription with type filter 
    108116---STRINGEND 
    109117 
     
    132140---STRINGEND 
    133141 
    134 ---STRING http post transport 
    135 HTTP POST transport 
     142---STRING %s %s could not be exported for replication because one of its parents is not approved 
     143%s %s could not be exported for replication because one of its parents is not approved 
    136144---STRINGEND 
    137145 
    138 ---STRING mirroring subscription 
    139 Mirroring Subscription 
    140 ---STRINGEND 
    141  
    142 ---STRING staging2live subscription with type filter 
    143 Staging2live subscription with type filter 
    144 ---STRINGEND 
  • trunk/midcom/midcom.helper.replicator/locale/default.fi.txt

    r12743 r16091  
    120120---STRINGEND 
    121121 
     122---STRING %s %s could not be exported for replication because one of its parents is not approved 
     123%s %s ei voida replikoida koska jokin sen vanhemmista ei ole hyvÀksytty. 
     124---STRINGEND 
     125