diff --git a/core/modules/rdf/rdf.module b/core/modules/rdf/rdf.module index 33d717c..3108ee1 100644 --- a/core/modules/rdf/rdf.module +++ b/core/modules/rdf/rdf.module @@ -236,6 +236,8 @@ function rdf_comment_storage_load($comments) { /** @var \Drupal\comment\CommentInterface $comment*/ $comment->rdf_data['date'] = rdf_rdfa_attributes($created_mapping, $comment->get('created')->first()->toArray()); $entity = $comment->getCommentedEntity(); + // The current function is a storage level hook, so avoid to bubble + // bubbleable metadata, because it can be outside of a render context. $comment->rdf_data['entity_uri'] = $entity->toUrl()->toString(TRUE)->getGeneratedUrl(); if ($comment->hasParentComment()) { $comment->rdf_data['pid_uri'] = $comment->getParentComment()->url(); diff --git a/core/modules/rest/src/Tests/UpdateTest.php b/core/modules/rest/src/Tests/UpdateTest.php index 0564a8b..98df739 100644 --- a/core/modules/rest/src/Tests/UpdateTest.php +++ b/core/modules/rest/src/Tests/UpdateTest.php @@ -274,7 +274,7 @@ public function testUpdateComment() { ]; $this->assertNotEqual('Updated subject', $comment->getSubject()); $comment->setSubject('Updated subject'); - $this->assertPatchEntity($comment, $read_only_fields, $account, 'hal_json', 'application/hal+json'); + $this->patchEntity($comment, $read_only_fields, $account, 'hal_json', 'application/hal+json'); $comment = Comment::load($comment->id()); $this->assertEqual('Updated subject', $comment->getSubject()); @@ -295,7 +295,7 @@ public function testUpdateComment() { ]; $this->assertNotEqual('Updated subject', $comment->getSubject()); $comment->setSubject('Updated subject'); - $this->assertPatchEntity($comment, $read_only_fields, $account, 'json', 'application/json'); + $this->patchEntity($comment, $read_only_fields, $account, 'json', 'application/json'); $comment = Comment::load($comment->id()); $this->assertEqual('Updated subject', $comment->getSubject()); } @@ -314,7 +314,7 @@ public function testUpdateComment() { * @param string $mime_type * The MIME type corresponding to the specified serialization format. */ - protected function assertPatchEntity(EntityInterface $entity, array $read_only_fields, AccountInterface $account, $format, $mime_type) { + protected function patchEntity(EntityInterface $entity, array $read_only_fields, AccountInterface $account, $format, $mime_type) { $serializer = $this->container->get('serializer'); $url = $entity->toUrl();