Permalink
Browse files

Pass "minisite" attribute to the request - Disable Task enqueing if i…

…t's set, as there is no TaskService and NotificationsLoaded in minisite
  • Loading branch information...
1 parent 84d3cf4 commit 6df6966de468cca0de3f00da5b8350aba0ac4852 @cdujeu cdujeu committed Sep 8, 2016
@@ -901,7 +901,7 @@ public function switchAction(ServerRequestInterface &$request, ResponseInterface
}
$size = 0;
$nodes = $selection->buildNodes();
- $bgSizeThreshold = 1*1024*1024;
+ $bgSizeThreshold = 10*1024*1024;
$bgWorkerThreshold = 80*1024*1024;
if(!MetaStreamWrapper::wrapperIsRemote($selection->currentBaseUrl())){
foreach($nodes as $node){
@@ -57,7 +57,7 @@ public function __construct($base, $linkHash, $rest = false)
{
$this->crtLinkHash = $linkHash;
$this->rest = $rest;
- parent::__construct($base);
+ parent::__construct($base, []);
if($rest){
ConfService::currentContextIsRestAPI($base);
}
@@ -222,8 +222,7 @@ public static function publicRoute($serverBase, $route, $params){
$base = new Base();
$h = $_GET['minisite_session'];
SessionService::setSessionName("AjaXplorer_Shared".str_replace(".","_",$h));
-
- $base->handleRoute($serverBase, "/");
+ $base->handleRoute($serverBase, "/", ["minisite" => true]);
}else{
@@ -358,7 +358,7 @@ public function copyOrMoveMetadataFromNode($originalNode, $nameSpace, $operation
*/
public function getParent(){
- if(empty($this->urlParts["path"]) || $this->urlParts["path"] == "/"){
+ if(empty($this->urlParts["path"]) || $this->urlParts["path"] === "/"){
return null;
}
$parent = new AJXP_Node(dirname($this->_url));
@@ -91,7 +91,9 @@ public function enqueueTask(Task $task, ServerRequestInterface $request = null,
return $response;
}
- if(ConfService::backgroundActionsSupported() && !ConfService::currentContextIsCommandLine()) {
+ $minisite = $request !== null && $request->getAttribute("minisite");
+
+ if(ConfService::backgroundActionsSupported() && !ConfService::currentContextIsCommandLine() && !$minisite) {
CliRunner::applyTaskInBackground($task);
return $response;

0 comments on commit 6df6966

Please sign in to comment.