Skip to content

Commit

Permalink
When manually grouping records, add the authorized author if availabl…
Browse files Browse the repository at this point in the history
…e rather than the original author
  • Loading branch information
mdnoble73 committed Jun 2, 2024
1 parent 1ad5f0a commit 0778aa2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions code/web/release_notes/24.06.00.MD
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- Show the grouping format that will be used for each value within the format table within an Indexing Profile. (*MDN*)
- Add a new Diagnostic panel for Grouped Work indexing. When selected, additional information will be stored for the work during indexing to help diagnose why records were given a particular format. (*MDN*)
- When normalizing subtitles, remove "The Graphic Novel" in addition to just "Graphic Novel" (Ticket 132083, 132354) (*MDN*)
- When manually grouping records, add the authorized author if available rather than the original author. (Ticket 132596) (*MDN*)
- Default format category of Wonderbook to Audio Books. (*MDN*)
- Add information to the log if a translation map value cannot be parsed as a regular expression. (*MDN*)
- Corrections for loading formats and grouping when using Mat Type from Sierra. (Ticket 130819) (*MDN*)
Expand Down
18 changes: 17 additions & 1 deletion code/web/services/GroupedWork/AJAX.php
Original file line number Diff line number Diff line change
Expand Up @@ -1729,7 +1729,23 @@ function processGroupWithForm() : array {
require_once ROOT_DIR . '/sys/Grouping/GroupedWorkAlternateTitle.php';
$groupedWorkAlternateTitle = new GroupedWorkAlternateTitle();
$groupedWorkAlternateTitle->permanent_id = $workToGroupWith->permanent_id;
$groupedWorkAlternateTitle->alternateAuthor = $originalGroupedWork->author;
//Check to see if the author has an authority
require_once ROOT_DIR . '/sys/Grouping/AuthorAuthority.php';
require_once ROOT_DIR . '/sys/Grouping/AuthorAuthorityAlternative.php';
$authorAuthorityAlternative = new AuthorAuthorityAlternative();
$authorAuthorityAlternative->normalized = $originalGroupedWork->author;
$useOriginalAuthor = true;
if ($authorAuthorityAlternative->find(true)) {
$authorAuthority = new AuthorAuthority();
$authorAuthority->id = $authorAuthorityAlternative->authorId;
if ($authorAuthority->find(true)) {
$useOriginalAuthor = false;
$groupedWorkAlternateTitle->alternateAuthor = $authorAuthority->normalized;
}
}
if ($useOriginalAuthor) {
$groupedWorkAlternateTitle->alternateAuthor = $originalGroupedWork->author;
}
$groupedWorkAlternateTitle->alternateTitle = $originalGroupedWork->full_title;
$groupedWorkAlternateTitle->alternateGroupingCategory = $originalGroupedWork->grouping_category;
if (!$groupedWorkAlternateTitle->find(true)) {
Expand Down

0 comments on commit 0778aa2

Please sign in to comment.