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

Commit

Permalink
Make sure to not propagate a share event to a workspace parent if it'…
Browse files Browse the repository at this point in the history
…s a template.
  • Loading branch information
cdujeu committed Jun 25, 2015
1 parent 894fdae commit baaf59f
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions core/src/plugins/action.share/class.ShareCenter.php
Expand Up @@ -632,19 +632,22 @@ private function findMirrorNodesInShares($node, $direction){
if($direction !== "DOWN"){
if($node->getRepository()->hasParent()){
$parentRepoId = $node->getRepository()->getParentId();
$currentRoot = $node->getRepository()->getOption("PATH");
$owner = $node->getRepository()->getOwner();
$resolveUser = null;
if($owner != null){
$resolveUser = ConfService::getConfStorageImpl()->createUserObject($owner);
}
$parentRoot = ConfService::getRepositoryById($parentRepoId)->getOption("PATH", false, $resolveUser);
$relative = substr($currentRoot, strlen($parentRoot));
$parentNodeURL = $node->getScheme()."://".$parentRepoId.$relative.$node->getPath();
$this->logDebug("action.share", "Should trigger on ".$parentNodeURL);
$parentNode = new AJXP_Node($parentNodeURL);
if($owner != null) $parentNode->setUser($owner);
$result[$parentRepoId] = array($parentNode, "UP");
$parentRepository = ConfService::getRepositoryById($parentRepoId);
if(!empty($parentRepository) && !$parentRepository->isTemplate){
$currentRoot = $node->getRepository()->getOption("PATH");
$owner = $node->getRepository()->getOwner();
$resolveUser = null;
if($owner != null){
$resolveUser = ConfService::getConfStorageImpl()->createUserObject($owner);
}
$parentRoot = $parentRepository->getOption("PATH", false, $resolveUser);
$relative = substr($currentRoot, strlen($parentRoot));
$parentNodeURL = $node->getScheme()."://".$parentRepoId.$relative.$node->getPath();
$this->logDebug("action.share", "Should trigger on ".$parentNodeURL);
$parentNode = new AJXP_Node($parentNodeURL);
if($owner != null) $parentNode->setUser($owner);
$result[$parentRepoId] = array($parentNode, "UP");
}
}
}
return $result;
Expand Down

1 comment on commit baaf59f

@mikerhyner
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This patch succeeded and seems to have some effect:
a) No XML Parse error appears on creating or deleting a directory
b) No error msg appears withinin apache error log
c) As far as I can see, it has also no bad impact on synchronization (dir or file sync works well in both directions)

Please sign in to comment.