diff --git a/code/web/release_notes/24.06.00.MD b/code/web/release_notes/24.06.00.MD index aafd78ad56..5f5154a167 100644 --- a/code/web/release_notes/24.06.00.MD +++ b/code/web/release_notes/24.06.00.MD @@ -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*) diff --git a/code/web/services/GroupedWork/AJAX.php b/code/web/services/GroupedWork/AJAX.php index 47182ecb06..615f4a48e5 100644 --- a/code/web/services/GroupedWork/AJAX.php +++ b/code/web/services/GroupedWork/AJAX.php @@ -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)) {