From 51bec80641ea8e32259779a1061d2b521f24a31b Mon Sep 17 00:00:00 2001 From: Thomas Hufschmidt Date: Fri, 11 Apr 2025 11:00:05 +0200 Subject: [PATCH 1/2] [MultiVC][fix] Ignore updates for deleted multivs objects and parents --- classes/class.ilMultiVcPlugin.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/classes/class.ilMultiVcPlugin.php b/classes/class.ilMultiVcPlugin.php index d4648754..da3d9697 100755 --- a/classes/class.ilMultiVcPlugin.php +++ b/classes/class.ilMultiVcPlugin.php @@ -69,6 +69,7 @@ public function handleEvent(string $a_component, string $a_event, array $a_param global $DIC; $logger = $DIC->logger()->root(); + $tree = $DIC->repositoryTree(); switch ($a_component) { case "Modules/Course": @@ -78,6 +79,8 @@ public function handleEvent(string $a_component, string $a_event, array $a_param foreach ($ref_ids as $ref_id) { $logger->debug('MultiVc: ' . $a_event . ' for RefId = ' . $ref_id . ' and UserId = ' . $a_parameter['usr_id']); + if ($tree->isDeleted($ref_id)) { continue; } + //todo cache? $xmvc_ref_ids = $DIC->repositoryTree()->getSubTree( $DIC->repositoryTree()->getNodeData($ref_id), From 47a8ef0e050cf90ce1388ad4a847f56b8b50eda3 Mon Sep 17 00:00:00 2001 From: Thomas Hufschmidt Date: Fri, 11 Apr 2025 11:01:02 +0200 Subject: [PATCH 2/2] [MultiVC][patch] Improve participant change event-handler performance --- classes/class.ilMultiVcConfig.php | 8 ++++++++ classes/class.ilMultiVcPlugin.php | 2 ++ 2 files changed, 10 insertions(+) diff --git a/classes/class.ilMultiVcConfig.php b/classes/class.ilMultiVcConfig.php index b5f59505..3ca25e77 100755 --- a/classes/class.ilMultiVcConfig.php +++ b/classes/class.ilMultiVcConfig.php @@ -1354,7 +1354,15 @@ public static function removeUnsafeChars(string $value): string return trim($value); } + public static function hasConnectionType(string $showcontent): bool + { + global $DIC; + $ilDB = $DIC->database(); + $result = $ilDB->query("SELECT showcontent FROM rep_robj_xmvc_conn where showcontent = " . $ilDB->quote($showcontent, 'text')); + $row = $ilDB->fetchAssoc($result); + return !(null === $row); + } diff --git a/classes/class.ilMultiVcPlugin.php b/classes/class.ilMultiVcPlugin.php index da3d9697..3fa6bc46 100755 --- a/classes/class.ilMultiVcPlugin.php +++ b/classes/class.ilMultiVcPlugin.php @@ -68,6 +68,8 @@ public function handleEvent(string $a_component, string $a_event, array $a_param { global $DIC; + if (!ilMultiVcConfig::hasConnectionType('teams')) { return ; } + $logger = $DIC->logger()->root(); $tree = $DIC->repositoryTree();