From b7b757d18ea63a305f4bb545f216705ffb8012db Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Wed, 22 Oct 2025 15:17:27 +0200 Subject: [PATCH 1/2] fix: Trigger both OCA and OCP ContentProviderRegisterEvent Signed-off-by: Marcel Klehr --- lib/Public/ContentManager.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Public/ContentManager.php b/lib/Public/ContentManager.php index 76b5390..add169e 100644 --- a/lib/Public/ContentManager.php +++ b/lib/Public/ContentManager.php @@ -12,7 +12,6 @@ use OCA\ContextChat\BackgroundJobs\SubmitContentJob; use OCA\ContextChat\Db\QueueContentItem; use OCA\ContextChat\Db\QueueContentItemMapper; -use OCA\ContextChat\Event\ContentProviderRegisterEvent; use OCA\ContextChat\Logger; use OCA\ContextChat\Service\ActionScheduler; use OCA\ContextChat\Service\ProviderConfigService; @@ -91,7 +90,9 @@ public function registerContentProvider(string $appId, string $providerId, strin * @since 2.2.2 */ public function collectAllContentProviders(): void { - $providerCollectionEvent = new ContentProviderRegisterEvent($this); + $providerCollectionEvent = new \OCA\ContextChat\Event\ContentProviderRegisterEvent($this); + $this->eventDispatcher->dispatchTyped($providerCollectionEvent); + $providerCollectionEvent = new \OCP\ContextChat\Events\ContentProviderRegisterEvent($this); $this->eventDispatcher->dispatchTyped($providerCollectionEvent); } From 6eea5088870cf49664c03d65590172cef16b0a4a Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Thu, 4 Dec 2025 08:14:10 +0100 Subject: [PATCH 2/2] fix: MetadataService#getIdFromSource: Fix regex Signed-off-by: Marcel Klehr --- lib/Service/MetadataService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Service/MetadataService.php b/lib/Service/MetadataService.php index 5c0dadd..745ceec 100644 --- a/lib/Service/MetadataService.php +++ b/lib/Service/MetadataService.php @@ -86,7 +86,7 @@ public function getEnrichedProviders(): array { private function getIdFromSource(string $sourceId): string { // note the ":" in the item id part - if (!preg_match('/^[a-zA-Z0-9_-]+__[a-zA-Z0-9_-]+: ([a-zA-Z0-9:-])+$/', $sourceId, $matches)) { + if (!preg_match('/^[a-zA-Z0-9_-]+__[a-zA-Z0-9_-]+: ([a-zA-Z0-9:-]+)$/', $sourceId, $matches)) { throw new \InvalidArgumentException("Invalid source id $sourceId"); } return $matches[1];