From de4610a475baa978534a9503a3da591d0c1e65ed Mon Sep 17 00:00:00 2001 From: Megan Schanz Date: Wed, 9 Oct 2024 16:32:04 -0400 Subject: [PATCH] Remove extra notes fields from description tab; limit subfields returned for abstract and summary --- .../Feature/MarcAdvancedTrait.php | 26 ++----------- .../Root/RecordDataFormatterFactory.php | 3 -- .../VuFind/tests/fixtures/marc/marctraits.xml | 1 + .../Feature/MarcAdvancedTraitTest.php | 39 ++++++------------- 4 files changed, 16 insertions(+), 53 deletions(-) diff --git a/module/VuFind/src/VuFind/RecordDriver/Feature/MarcAdvancedTrait.php b/module/VuFind/src/VuFind/RecordDriver/Feature/MarcAdvancedTrait.php index 7ad8da93851..30c2e32e696 100644 --- a/module/VuFind/src/VuFind/RecordDriver/Feature/MarcAdvancedTrait.php +++ b/module/VuFind/src/VuFind/RecordDriver/Feature/MarcAdvancedTrait.php @@ -1254,7 +1254,7 @@ public function getMarcFieldWithInd( */ public function getLocationOfArchivalMaterialsNotes() { - return $this->getMarcFieldWithInd('544', null, [[1 => ['', '0']]]); + return $this->getMarcFieldWithInd('544', range('a', 'z'), [[1 => ['', '0']]]); } /** @@ -1274,17 +1274,7 @@ public function getSummary() */ public function getSummaryNotes() { - return $this->getMarcFieldWithInd('520', null, [[1 => ['', '0', '2', '8']]]); - } - - /** - * Get the review by notes - * - * @return array Note fields from the MARC record - */ - public function getReviewNotes() - { - return $this->getMarcFieldWithInd('520', null, [[1 => ['1']]]); + return $this->getMarcFieldWithInd('520', range('a', 'z'), [[1 => ['', '0', '2', '8']]]); } /** @@ -1294,16 +1284,6 @@ public function getReviewNotes() */ public function getAbstractNotes() { - return $this->getMarcFieldWithInd('520', null, [[1 => ['3']]]); - } - - /** - * Get the content advice notes - * - * @return array Note fields from the MARC record - */ - public function getContentAdviceNotes() - { - return $this->getMarcFieldWithInd('520', null, [[1 => ['4']]]); + return $this->getMarcFieldWithInd('520', range('a', 'z'), [[1 => ['3']]]); } } diff --git a/module/VuFind/src/VuFind/View/Helper/Root/RecordDataFormatterFactory.php b/module/VuFind/src/VuFind/View/Helper/Root/RecordDataFormatterFactory.php index 0dccba7245d..086cde54380 100644 --- a/module/VuFind/src/VuFind/View/Helper/Root/RecordDataFormatterFactory.php +++ b/module/VuFind/src/VuFind/View/Helper/Root/RecordDataFormatterFactory.php @@ -369,9 +369,6 @@ public function getDefaultDescriptionSpecs() { $spec = new RecordDataFormatter\SpecBuilder(); $spec->setTemplateLine('Summary', true, 'data-summary.phtml'); - $spec->setLine('Abstract', 'getAbstractNotes'); - $spec->setLine('Review', 'getReviewNotes'); - $spec->setLine('Content Advice', 'getContentAdviceNotes'); $spec->setLine('Published', 'getDateSpan'); $spec->setLine('Item Description', 'getGeneralNotes'); $spec->setLine('Physical Description', 'getPhysicalDescriptions'); diff --git a/module/VuFind/tests/fixtures/marc/marctraits.xml b/module/VuFind/tests/fixtures/marc/marctraits.xml index 6d308083d23..046a8180e7f 100644 --- a/module/VuFind/tests/fixtures/marc/marctraits.xml +++ b/module/VuFind/tests/fixtures/marc/marctraits.xml @@ -138,6 +138,7 @@ Review Note. Expanded. + http://expanded. Abstract. diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/RecordDriver/Feature/MarcAdvancedTraitTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/RecordDriver/Feature/MarcAdvancedTraitTest.php index 6040ae4aeba..0abd637b9ba 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/RecordDriver/Feature/MarcAdvancedTraitTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/RecordDriver/Feature/MarcAdvancedTraitTest.php @@ -288,62 +288,47 @@ public function testGetMarcFieldWithIndNoValues(): void } /** - * Test calling getSummaryNotes to get expected marc data + * Test calling getSummary to get expected marc data * * @return void */ - public function testGetSummaryNotes(): void + public function testGetSummary(): void { $obj = $this->getMockDriverFromFixture('marc/marctraits.xml'); $this->assertEquals( - ['Summary. Expanded.'], - $obj->getSummaryNotes() + ['Summary.'], + $obj->getSummary() ); } /** - * Test calling getAbstractNotes to get expected marc data - * - * @return void - */ - public function testGetAbstractNotes(): void - { - $obj = $this->getMockDriverFromFixture('marc/marctraits.xml'); - - $this->assertEquals( - ['Abstract. Expanded.'], - $obj->getAbstractNotes() - ); - } - - /** - * Test calling getReviewNotes to get expected marc data + * Test calling getSummaryNotes to get expected marc data * * @return void */ - public function testGetReviewNotes(): void + public function testGetSummaryNotes(): void { $obj = $this->getMockDriverFromFixture('marc/marctraits.xml'); $this->assertEquals( - ['Review Note. Expanded.'], - $obj->getReviewNotes() + ['Summary. Expanded.'], + $obj->getSummaryNotes() ); } /** - * Test calling getContentAdviceNotes to get expected marc data + * Test calling getAbstractNotes to get expected marc data * * @return void */ - public function testGetContentAdviceNotes(): void + public function testGetAbstractNotes(): void { $obj = $this->getMockDriverFromFixture('marc/marctraits.xml'); $this->assertEquals( - ['Content Advice. Expanded.'], - $obj->getContentAdviceNotes() + ['Abstract. Expanded.'], + $obj->getAbstractNotes() ); }