Skip to content

Commit

Permalink
Remove extra notes fields from description tab; limit subfields retur…
Browse files Browse the repository at this point in the history
…ned for abstract and summary
  • Loading branch information
meganschanz committed Oct 9, 2024
1 parent c796426 commit de4610a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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']]]);
}

/**
Expand All @@ -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']]]);
}

/**
Expand All @@ -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']]]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
1 change: 1 addition & 0 deletions module/VuFind/tests/fixtures/marc/marctraits.xml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@
<datafield tag="520" ind1="1" ind2=" ">
<subfield code="a">Review Note.</subfield>
<subfield code="b">Expanded.</subfield>
<subfield code="1">http://expanded.</subfield>
</datafield>
<datafield tag="520" ind1="3" ind2=" ">
<subfield code="a">Abstract.</subfield>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
);
}

Expand Down

0 comments on commit de4610a

Please sign in to comment.