aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/workflowengine/lib/Service/RuleMatcher.php18
-rw-r--r--lib/private/Preview/Office.php2
2 files changed, 11 insertions, 9 deletions
diff --git a/apps/workflowengine/lib/Service/RuleMatcher.php b/apps/workflowengine/lib/Service/RuleMatcher.php
index 6186df1d7b9..57e3813c309 100644
--- a/apps/workflowengine/lib/Service/RuleMatcher.php
+++ b/apps/workflowengine/lib/Service/RuleMatcher.php
@@ -121,14 +121,16 @@ class RuleMatcher implements IRuleMatcher {
$operations = array_merge($operations, $this->manager->getOperations($class, $scope));
}
- $additionalScopes = $this->manager->getAllConfiguredScopesForOperation($class);
- foreach ($additionalScopes as $hash => $scopeCandidate) {
- /** @var ScopeContext $scopeCandidate */
- if ($scopeCandidate->getScope() !== IManager::SCOPE_USER || in_array($scopeCandidate, $scopes)) {
- continue;
- }
- if ($this->entity->isLegitimatedForUserId($scopeCandidate->getScopeId())) {
- $operations = array_merge($operations, $this->manager->getOperations($class, $scopeCandidate));
+ if($this->entity instanceof IEntity) {
+ $additionalScopes = $this->manager->getAllConfiguredScopesForOperation($class);
+ foreach ($additionalScopes as $hash => $scopeCandidate) {
+ /** @var ScopeContext $scopeCandidate */
+ if ($scopeCandidate->getScope() !== IManager::SCOPE_USER || in_array($scopeCandidate, $scopes)) {
+ continue;
+ }
+ if ($this->entity->isLegitimatedForUserId($scopeCandidate->getScopeId())) {
+ $operations = array_merge($operations, $this->manager->getOperations($class, $scopeCandidate));
+ }
}
}
diff --git a/lib/private/Preview/Office.php b/lib/private/Preview/Office.php
index af6a2ef89f8..bdf8c528135 100644
--- a/lib/private/Preview/Office.php
+++ b/lib/private/Preview/Office.php
@@ -60,7 +60,7 @@ abstract class Office extends ProviderV2 {
$pngPreview = null;
try {
list($dirname, , , $filename) = array_values(pathinfo($absPath));
- $pngPreview = $dirname . '/' . $filename . '.png';
+ $pngPreview = $tmpDir . '/' . $filename . '.png';
$png = new \imagick($pngPreview . '[0]');
$png->setImageFormat('jpg');