Skip to content

Commit

Permalink
Error handling when viewing records that are not linked to a grouped …
Browse files Browse the repository at this point in the history
…work
  • Loading branch information
mdnoble73 committed Apr 29, 2024
1 parent 8aa0c37 commit 09a1d19
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
20 changes: 11 additions & 9 deletions code/web/RecordDrivers/GroupedWorkDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -3267,16 +3267,18 @@ public function getGroupedWorkDetails() {
$groupedWork = new GroupedWork();
$groupedWork->permanent_id = $this->getPermanentId();
$groupedWorkDetails = [];
if ($groupedWork->find(true)) {
$groupedWorkDetails['Full title'] = $groupedWork->full_title;
$groupedWorkDetails['Author'] = $groupedWork->author;
$groupedWorkDetails['Grouping Category'] = $groupedWork->grouping_category;
$groupedWorkDetails['Last Update'] = date('Y-m-d H:i:sA', $groupedWork->date_updated);
if ($this->fields != null && array_key_exists('last_indexed', $this->fields)) {
$groupedWorkDetails['Last Indexed'] = date('Y-m-d H:i:sA', strtotime($this->fields['last_indexed']));
if (!empty($groupedWork->permanent_id)) {
if ($groupedWork->find(true)) {
$groupedWorkDetails['Full title'] = $groupedWork->full_title;
$groupedWorkDetails['Author'] = $groupedWork->author;
$groupedWorkDetails['Grouping Category'] = $groupedWork->grouping_category;
$groupedWorkDetails['Last Update'] = date('Y-m-d H:i:sA', $groupedWork->date_updated);
if ($this->fields != null && array_key_exists('last_indexed', $this->fields)) {
$groupedWorkDetails['Last Indexed'] = date('Y-m-d H:i:sA', strtotime($this->fields['last_indexed']));
}
} else {
$groupedWorkDetails['Deleted?'] = 'This work has been deleted from the database and should be re-indexed';
}
} else {
$groupedWorkDetails['Deleted?'] = 'This work has been deleted from the database and should be re-indexed';
}
return $groupedWorkDetails;
}
Expand Down
2 changes: 1 addition & 1 deletion code/web/release_notes/24.05.00.MD
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
- Work on moving packages for Aspen Discovery indexing code. (*MDN*)
- Allow footer logo alt to be inherited from parent theme. (Ticket 131044) (*MDN*)
- Fix updating saved searches. (*MDN*)

- Error handling when viewing records that are not linked to a grouped work. (*MDN*)

//kirstien
### API Updates
Expand Down

0 comments on commit 09a1d19

Please sign in to comment.