Permalink
Browse files

Fix hooks node.share.create and node.share.update by passing the node…

… as first argument (context provider).
  • Loading branch information...
1 parent f6d66f8 commit e6aba0965121b6896cc44db28f8454db8bf14f89 @cdujeu cdujeu committed Aug 24, 2016
Showing with 4 additions and 4 deletions.
  1. +4 −4 core/src/plugins/action.share/src/ShareCenter.php
@@ -618,12 +618,12 @@ public function switchAction(ServerRequestInterface &$requestInterface, Response
"OWNER_ID" => $ctx->getUser()->getId()), "repository");
}
- Controller::applyHook( ($isUpdate ? "node.share.update" : "node.share.create"), array(
+ Controller::applyHook( ($isUpdate ? "node.share.update" : "node.share.create"), [$ajxpNode, array(
'type' => 'repository',
'repository' => &$this->repository,
'accessDriver' => &$this->accessDriver,
'new_repository' => &$result
- ));
+ )]);
if ($ajxpNode->hasMetaStore() && !$ajxpNode->isRoot()) {
$this->getShareStore()->getMetaManager()->addShareInMeta(
@@ -1618,14 +1618,14 @@ public function createSharedMinisite($httpVars, &$update)
"limit" => $data['DOWNLOAD_LIMIT'],
"repo_uuid" => $this->repository->getId()
));
- Controller::applyHook("node.share.".($update?"update":"create"), array(
+ Controller::applyHook("node.share.".($update?"update":"create"), [$userSelection->getUniqueNode(), array(
'type' => 'minisite',
'repository' => &$this->repository,
'accessDriver' => &$this->accessDriver,
'data' => &$data,
'url' => $url,
'new_repository' => &$newRepo
- ));
+ )]);
return array($hash, $url);
}

0 comments on commit e6aba09

Please sign in to comment.