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

Commit

Permalink
ShareCenter : forward change event if node has a minisite on it, by f…
Browse files Browse the repository at this point in the history
…orwarding to root node in shared repo.
  • Loading branch information
cdujeu committed Oct 4, 2016
1 parent dddf87c commit 866b314
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
12 changes: 10 additions & 2 deletions core/src/plugins/action.share/src/ShareCenter.php
Expand Up @@ -48,6 +48,7 @@
use Pydio\Core\Services\UsersService;
use Pydio\Core\Services\ApplicationState;
use Pydio\Core\Utils\Vars\InputFilter;
use Pydio\Core\Utils\Vars\PathUtils;
use Pydio\Core\Utils\Vars\XMLFilter;
use Pydio\Core\PluginFramework\Plugin;
use Pydio\Core\PluginFramework\PluginsService;
Expand Down Expand Up @@ -1225,10 +1226,17 @@ private function findMirrorNodesInShares($node, $direction){
continue;
}
$sharedNode = $metadata["SOURCE_NODE"];
$sharedPath = substr($node->getPath(), strlen($sharedNode->getPath()));
if($sharedNode === $node){
// This is a minisite on one file, using a content filter, send a node.change on root to force clear cache
$sharedPath = "/";
}else{
$sharedPath = substr($node->getPath(), strlen($sharedNode->getPath()));
}
$newContext = $crtContext->withRepositoryId($wsId);
$sharedNodeUrl = $newContext->getUrlBase().$sharedPath;
$result[$wsId] = array(new AJXP_Node($sharedNodeUrl), "DOWN");
$newNode = new AJXP_Node($sharedNodeUrl);
if($sharedPath === '/') $newNode->setLeaf(false);
$result[$wsId] = array($newNode, "DOWN");
$this->logDebug('MIRROR NODES', 'Found shared in parent - register node '.$sharedNodeUrl);
}
}
Expand Down
7 changes: 7 additions & 0 deletions core/src/plugins/action.share/src/Store/ShareMetaManager.php
Expand Up @@ -129,6 +129,13 @@ public function removeShareFromMeta($node, $shareId){
*/
public function collectSharesInParent($node, &$metas){
$node->collectMetadataInParents(AJXP_SHARED_META_NAMESPACE, AJXP_METADATA_ALLUSERS, AJXP_METADATA_SCOPE_REPOSITORY, false, $metas);
if($node->isLeaf()){
$metadata = $node->retrieveMetadata(AJXP_SHARED_META_NAMESPACE, AJXP_METADATA_ALLUSERS, AJXP_METADATA_SCOPE_REPOSITORY,false);
if($metadata != false){
$metadata["SOURCE_NODE"] = $node;
$metas[] = $metadata;
}
}
}

/**
Expand Down

0 comments on commit 866b314

Please sign in to comment.