Skip to content

Commit

Permalink
Update ItemAPI.php
Browse files Browse the repository at this point in the history
  • Loading branch information
catsoup11789 committed Apr 1, 2024
1 parent 081f209 commit 8aadf29
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion code/web/services/API/ItemAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -1166,10 +1166,19 @@ function getVariations() {
/** @var File_MARC_Control_Field $oclcNumber */
$oclcNumber = $relatedRecordDriver->getOCLCNumber();

$actionButtons = [];
$actions = $relatedVariation->getActions();
foreach ($actions as $key => $action) {
$actionButtons[$key]['id'] = $action['id'] . '_' . $key;
$actionButtons[$key]['type'] = $action['type'];
$actionButtons[$key]['title'] = $action['title'];
$actionButtons[$key]['requireLogin'] = $action['requireLogin'];
}

$variations[$relatedVariation->label]['id'] = $relatedRecord->id;
$variations[$relatedVariation->label]['source'] = $relatedRecord->source;
$variations[$relatedVariation->label]['closedCaptioned'] = (int) $relatedRecord->closedCaptioned;
$variations[$relatedVariation->label]['actions'] = $relatedVariation->getActions();
$variations[$relatedVariation->label]['actions'] = $actionButtons;
$variations[$relatedVariation->label]['variationId'] = $relatedVariation->databaseId;
$variations[$relatedVariation->label]['holdType'] = $holdType;
$variations[$relatedVariation->label]['statusIndicator'] = [
Expand Down

0 comments on commit 8aadf29

Please sign in to comment.