diff --git a/src/Serializer/ArticleVoRNormalizer.php b/src/Serializer/ArticleVoRNormalizer.php index 2238411a..80940d37 100644 --- a/src/Serializer/ArticleVoRNormalizer.php +++ b/src/Serializer/ArticleVoRNormalizer.php @@ -456,13 +456,6 @@ protected function normalizeArticle( if ($article->getElifeAssessmentTitle()) { $data['elifeAssessment'] = [ 'title' => $article->getElifeAssessmentTitle(), - 'content' => $article->getElifeAssessmentArticleSection()->getContent() - ->map(function (Block $block) use ( - $format, - $context - ) { - return $this->normalizer->normalize($block, $format, $context); - })->toArray(), ]; } @@ -473,6 +466,13 @@ protected function normalizeArticle( if ($article->getElifeAssessmentArticleSection()) { $data['elifeAssessment']['doi'] = $article->getElifeAssessmentArticleSection()->getDoi(); $data['elifeAssessment']['id'] = $article->getElifeAssessmentArticleSection()->getId(); + $data['elifeAssessment']['content'] = $article->getElifeAssessmentArticleSection()->getContent() + ->map(function (Block $block) use ( + $format, + $context + ) { + return $this->normalizer->normalize($block, $format, $context); + })->toArray(); } if (empty($context['snippet'])) { diff --git a/test/Serializer/ArticleVoRNormalizerTest.php b/test/Serializer/ArticleVoRNormalizerTest.php index 2990db28..cff73f78 100644 --- a/test/Serializer/ArticleVoRNormalizerTest.php +++ b/test/Serializer/ArticleVoRNormalizerTest.php @@ -657,15 +657,15 @@ function ($test) { 'impactStatement' => 'A new hominin species has been unearthed in the Dinaledi Chamber of the Rising Star cave system in the largest assemblage of a single species of hominins yet discovered in Africa.', 'elifeAssessment' => [ 'title' => 'eLife assessment', + 'scietyUri' => 'https://elife-assessment-09560.com', + 'doi' => '10.7554/eLife.09560elifeAssessment', + 'id' => 'elife-assessment-id', 'content' => [ [ 'type' => 'paragraph', 'text' => 'Article 09560 elife assessment text', ], ], - 'scietyUri' => 'https://elife-assessment-09560.com', - 'doi' => '10.7554/eLife.09560elifeAssessment', - 'id' => 'elife-assessment-id', // 'significance' => ['landmark'], // 'strength' => ['solid'], ]