Skip to content

Commit

Permalink
Add filter method for AIPA fields
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksip committed Dec 12, 2023
1 parent b7093ca commit bfc1d2d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 28 deletions.
16 changes: 16 additions & 0 deletions module/Finna/src/Finna/View/Helper/Root/RecordDataFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,21 @@ public function filterForwardFields($coreFields)
return $this->filterFields($coreFields, $include);
}

/**
* Filter unnecessary fields from AIPA records.
*
* @param array $coreFields data to filter.
*
* @return array
*/
public function filterAipaFields($coreFields)
{
$aipaFields = $this->filterQDCFields($coreFields);
unset($aipaFields['Language']);
unset($aipaFields['Subjects']);
return $aipaFields;
}

/**
* Get default configuration.
*
Expand All @@ -575,6 +590,7 @@ public function getDefaults($key = 'core'): array
}
switch ($type) {
case 'aipa':
return $this->filterAipaFields($defaults);
case 'dc':
case 'qdc':
return $this->filterQDCFields($defaults);
Expand Down
28 changes: 0 additions & 28 deletions themes/finna2/templates/RecordDriver/SolrAipa/core-fields.phtml

This file was deleted.

0 comments on commit bfc1d2d

Please sign in to comment.