Skip to content
Snippets Groups Projects
Commit de8d18e1 authored by Ere Maijala's avatar Ere Maijala Committed by Demian Katz
Browse files

Fixes displaying of purchase history when it is split to the appropriate holdings. (#992)

- Handle purchase history separately from text fields since it's different. 
parent 5fac0def
No related merge requests found
...@@ -115,9 +115,7 @@ class Holds ...@@ -115,9 +115,7 @@ class Holds
{ {
$retVal = []; $retVal = [];
// Handle purchase history alongside other textual fields
$textFieldNames = $this->catalog->getHoldingsTextFieldNames(); $textFieldNames = $this->catalog->getHoldingsTextFieldNames();
$textFieldNames[] = 'purchase_history';
foreach ($holdings as $groupKey => $items) { foreach ($holdings as $groupKey => $items) {
$retVal[$groupKey] = [ $retVal[$groupKey] = [
...@@ -156,6 +154,16 @@ class Holds ...@@ -156,6 +154,16 @@ class Holds
} }
} }
} }
// Handle purchase history
if (!empty($item['purchase_history'])) {
$targetRef = & $retVal[$groupKey]['purchase_history'];
foreach ((array)$item['purchase_history'] as $field) {
if (empty($targetRef) || !in_array($field, $targetRef)) {
$targetRef[] = $field;
}
}
}
} }
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment