diff --git a/src/lib/Persistence/Cache/ContentHandler.php b/src/lib/Persistence/Cache/ContentHandler.php index ca2b00dc70..84433773b1 100644 --- a/src/lib/Persistence/Cache/ContentHandler.php +++ b/src/lib/Persistence/Cache/ContentHandler.php @@ -446,6 +446,10 @@ public function addRelation(RelationCreateStruct $relation) self::CONTENT_IDENTIFIER, [$relation->destinationContentId] ), + $this->cacheIdentifierGenerator->generateTag( + self::CONTENT_IDENTIFIER, + [$relation->sourceContentId] + ), ]); return $this->persistenceHandler->contentHandler()->addRelation($relation); diff --git a/tests/lib/Persistence/Cache/ContentHandlerTest.php b/tests/lib/Persistence/Cache/ContentHandlerTest.php index 5cc12827ab..dc971c41f8 100644 --- a/tests/lib/Persistence/Cache/ContentHandlerTest.php +++ b/tests/lib/Persistence/Cache/ContentHandlerTest.php @@ -52,7 +52,7 @@ public function providerForUnCachedMethods(): array ['updateContent', [2, 1, new UpdateStruct()], [['content_version', [2, 1], false]], null, ['c-2-v-1']], //['deleteContent', [2]], own tests for relations complexity ['deleteVersion', [2, 1], [['content_version', [2, 1], false]], null, ['c-2-v-1']], - ['addRelation', [new RelationCreateStruct(['destinationContentId' => 2])], [['content', [2], false]], null, ['c-2']], + ['addRelation', [new RelationCreateStruct(['destinationContentId' => 2, 'sourceContentId' => 4])], [['content', [2], false], ['content', [4], false]], null, ['c-2', 'c-4']], ['removeRelation', [66, APIRelation::COMMON, 2], [['content', [2], false], ['relation', [66], false]], null, ['c-2', 're-66']], ['loadRelations', [2, 1, 3]], ['loadReverseRelations', [2, 3]],