Skip to content

Commit ae9dcf6

Browse files
authored
Merge pull request #608 from Slange-Mhath/master
fixed the bug that the entries are displayed as arrays on lhsacasenot…
2 parents 5633cc4 + c5352d0 commit ae9dcf6

File tree

3 files changed

+33
-17
lines changed

3 files changed

+33
-17
lines changed

config/mimed.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,13 @@
116116
'Accession Number' => 'dc.identifier.en'
117117
);
118118

119-
$config['skylight_related_fields'] = array('Instrument' => 'dc.type.en', 'Genus' => 'dc.type.genus.en');
119+
// BUGFIX: Identifier added as a hack to prevent records missing either dc.type.en or dc.type.genus.en from passing *all* their solr data to the getRelatedItems function and overloading the URL
120+
// We used identifier, because it shouldn't change the returned results at all, following this logic:
121+
// 1) The search terms are quoted, so a search on the quoted identifier should only ever return the same record
122+
// 2) The function adds a query parameter to remove matches with the same handle (to prevent the same record showing up in its own Related Items block)
123+
// 3) Therefore, the two operations will cancel each other out and not return an additional result
124+
// Sebastian + Mike - 10th Aug 2020
125+
$config['skylight_related_fields'] = array('Instrument' => 'dc.type.en', 'Genus' => 'dc.type.genus.en', 'Identifier' => 'dc.identifier.en');
120126

121127
//only by title, no date at the moment
122128
$config['skylight_sort_fields'] = array(

theme/lhsacasenotes/views/record.php

+11-4
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,17 @@
6464
echo $metadatavalue;
6565
$idset = true;
6666
}
67-
}
68-
else{
69-
70-
echo $metadatavalue;
67+
} //13.08.2020 Sebastian Lange: Dates and Extent were falsly outputted as array this fairly horrible if else statement fixed it
68+
else {
69+
if($key == 'Dates'){
70+
echo ($metadatavalue['expression']);
71+
}
72+
if($key == 'Extent'){
73+
echo ($metadatavalue['number']);
74+
}
75+
elseif ($key != 'Dates') {
76+
echo ($metadatavalue);
77+
}
7178
}
7279
}
7380

theme/towardsdolly/views/record.php

+15-12
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,24 @@
4747

4848
echo '<a href="./search/*:*/' . $key . ':%22'.$orig_filter.'%22">'.$metadatavalue.'</a>';
4949
}
50-
else
51-
{
52-
if ($key == 'Identifier')
53-
{
54-
if ($idset == false)
55-
{
50+
else {
51+
if ($key == 'Identifier') {
52+
if ($idset == false) {
5653
echo $metadatavalue;
5754
$idset = true;
5855
}
56+
} //13.08.2020 Sebastian Lange: Dates and Extent were falsly outputted as array this fairly horrible if else statement fixed it
57+
else {
58+
if($key == 'Dates'){
59+
echo ($metadatavalue['expression']);
60+
}
61+
if($key == 'Extent'){
62+
echo ($metadatavalue['number']);
63+
}
64+
elseif ($key != 'Dates') {
65+
echo ($metadatavalue);
66+
}
5967
}
60-
else
61-
{
62-
echo $metadatavalue;
63-
}
64-
6568
}
6669

6770
if($index < sizeof($solr[$element]) - 1) {
@@ -88,4 +91,4 @@
8891

8992

9093
<input type="button" value="Back to Search Results" class="backbtn" onClick="history.go(-1);">
91-
</div>
94+
</div>

0 commit comments

Comments
 (0)