React Content Query: Lookup column additional fields fix (#925)

Fix: React Content Query web part does not display values from lookup column additional fields.
This commit is contained in:
Ivan Peters 2019-07-28 22:23:03 +12:00 committed by Vesa Juvonen
parent f198118429
commit 617990be70
1 changed files with 4 additions and 3 deletions

View File

@ -565,13 +565,14 @@ export class ContentQueryService implements IContentQueryService {
for(let result of results) {
let normalizedResult: any = {};
let formattedCharsRegex = /_x00(20|3a)_/gi;
for(let viewField of viewFields) {
let spacesFormattedName = viewField.replace(new RegExp("_x0020_", "g"), "_x005f_x0020_x005f_");
let formattedName = viewField.replace(formattedCharsRegex, "_x005f_x00$1_x005f_");
normalizedResult[viewField] = {
textValue: result.FieldValuesAsText[spacesFormattedName],
htmlValue: result.FieldValuesAsHtml[spacesFormattedName],
textValue: result.FieldValuesAsText[formattedName],
htmlValue: result.FieldValuesAsHtml[formattedName],
rawValue: result[viewField] || result[viewField + 'Id']
};
}