Permalink
Browse files

ShareCenter : forward change event if node has a minisite on it, by f…

…orwarding to root node in shared repo.
  • Loading branch information...
1 parent dddf87c commit 866b3143f4ef252f4421e2a57f00b82844a7e7de @cdujeu cdujeu committed Oct 4, 2016
@@ -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;
@@ -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);
}
}
@@ -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;
+ }
+ }
}
/**

0 comments on commit 866b314

Please sign in to comment.