Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit 803d7fd

Browse files
committed
ShareCenter: Catch exceptions when forwarding changes, otherwise it stops the loop.
1 parent b8a14e9 commit 803d7fd

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

core/src/plugins/action.share/class.ShareCenter.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,14 +648,26 @@ private function applyForwardEvent($fromMirrors = null, $toMirrors = null, $copy
648648
if(isSet($toMirrors[$repoId])){
649649
list($tNode, $tDirection) = $toMirrors[$repoId];
650650
unset($toMirrors[$repoId]);
651-
AJXP_Controller::applyHook("node.change", array($fNode, $tNode, $copy, $fDirection), true);
651+
try{
652+
AJXP_Controller::applyHook("node.change", array($fNode, $tNode, $copy, $fDirection), true);
653+
}catch(Exception $e){
654+
$this->logError(__FUNCTION__, "Error while applying node.change hook (".$e->getMessage().")");
655+
}
652656
}else{
657+
try{
653658
AJXP_Controller::applyHook("node.change", array($fNode, null, $copy, $fDirection), true);
659+
}catch(Exception $e){
660+
$this->logError(__FUNCTION__, "Error while applying node.change hook (".$e->getMessage().")");
661+
}
654662
}
655663
}
656664
foreach($toMirrors as $mirror){
657665
list($tNode, $tDirection) = $mirror;
666+
try{
658667
AJXP_Controller::applyHook("node.change", array(null, $tNode, $copy, $tDirection), true);
668+
}catch(Exception $e){
669+
$this->logError(__FUNCTION__, "Error while applying node.change hook (".$e->getMessage().")");
670+
}
659671
}
660672
}
661673

0 commit comments

Comments
 (0)