Skip to content

Commit

Permalink
Fixed wrong table reference
Browse files Browse the repository at this point in the history
Fixes collectiveaccess#115

By calling `getRepresentationRelationshipTableName` with a representation, the script was looking for a representation x representation relationship.  This is wrong.  The related object needs to be passed instead.
  • Loading branch information
miqrogroove authored Sep 5, 2024
1 parent 923cf8e commit 7f8967a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/helpers/displayHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -4296,7 +4296,7 @@ function caRepresentationViewer($po_request, $po_data, $pt_subject, $pa_options=
$vn_index = null;
if($vn_rep_id == $vn_primary_id){
$vn_index = 0;
}elseif (!($vn_index = (int)$qr_reps->get(RepresentableBaseModel::getRepresentationRelationshipTableName($qr_reps->tableName()).'.rank'))) {
}elseif (!($vn_index = (int)$qr_reps->get(RepresentableBaseModel::getRepresentationRelationshipTableName($pt_subject->tableName()).'.rank'))) {
$vn_index = $qr_reps->get('ca_object_representations.representation_id');
}
$va_rep_info[$vn_index] = array("rep_id" => $vn_rep_id, "tag" => $va_rep_tags[$vn_rep_id]);
Expand Down

0 comments on commit 7f8967a

Please sign in to comment.