summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/private/SystemTag/SystemTagObjectMapper.php8
-rw-r--r--lib/private/TemplateLayout.php2
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/private/SystemTag/SystemTagObjectMapper.php b/lib/private/SystemTag/SystemTagObjectMapper.php
index f8a1b03cd01..f1f39fd7d0a 100644
--- a/lib/private/SystemTag/SystemTagObjectMapper.php
+++ b/lib/private/SystemTag/SystemTagObjectMapper.php
@@ -154,20 +154,26 @@ class SystemTagObjectMapper implements ISystemTagObjectMapper {
'systemtagid' => $query->createParameter('tagid'),
]);
+ $tagsAssigned = [];
foreach ($tagIds as $tagId) {
try {
$query->setParameter('tagid', $tagId);
$query->execute();
+ $tagsAssigned[] = $tagId;
} catch (UniqueConstraintViolationException $e) {
// ignore existing relations
}
}
+ if (empty($tagsAssigned)) {
+ return;
+ }
+
$this->dispatcher->dispatch(MapperEvent::EVENT_ASSIGN, new MapperEvent(
MapperEvent::EVENT_ASSIGN,
$objectType,
$objId,
- $tagIds
+ $tagsAssigned
));
}
diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php
index f23ec97119f..94b39e951a5 100644
--- a/lib/private/TemplateLayout.php
+++ b/lib/private/TemplateLayout.php
@@ -113,6 +113,8 @@ class TemplateLayout extends \OC_Template {
$this->assign('themingInvertMenu', $util->invertTextColor(\OC::$server->getThemingDefaults()->getColorPrimary()));
} catch (\OCP\AppFramework\QueryException $e) {
$this->assign('themingInvertMenu', false);
+ } catch (\OCP\AutoloadNotAllowedException $e) {
+ $this->assign('themingInvertMenu', false);
}
} else if ($renderAs === 'error') {