Skip to content

Commit

Permalink
Check to see if format field has a valid value and that it's in the f…
Browse files Browse the repository at this point in the history
…ormat map before translating it
  • Loading branch information
mdnoble73 committed May 13, 2024
1 parent 1498b7c commit 25cb772
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Binary file modified code/reindexer/reindexer.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,14 @@ public FormatInfo getFormatInfoForItem(DataField itemField, BaseIndexingSettings

if (!foundFormatFromShelfLocation && !foundFormatFromSublocation && !foundFormatFromCollection && !foundFormatFromIType) {
String format = MarcUtil.getItemSubfieldData(profile.getFormatSubfield(), itemField, logEntry, logger);
String translatedFormat = profile.translateValue("format", format);
if (translatedFormat != null && !translatedFormat.isEmpty()) {
formatInfo.format = translatedFormat;
formatInfo.formatCategory = profile.translateValue("format_category", format);
if (profile.hasTranslation("format_boost", format)) {
formatBoost = profile.translateValue("format_boost", format);
if (format != null && profile.hasTranslation("format", format)) {
String translatedFormat = profile.translateValue("format", format);
if (translatedFormat != null && !translatedFormat.isEmpty()) {
formatInfo.format = translatedFormat;
formatInfo.formatCategory = profile.translateValue("format_category", format);
if (profile.hasTranslation("format_boost", format)) {
formatBoost = profile.translateValue("format_boost", format);
}
}
}
}
Expand Down

0 comments on commit 25cb772

Please sign in to comment.