mirror of
https://github.com/pnp/sp-dev-fx-webparts.git
synced 2025-03-02 01:39:21 +00:00
fix field begins with a special character
This commit is contained in:
parent
e15d1b3eb7
commit
70123cbba5
@ -47,6 +47,7 @@ Version|Date|Comments
|
||||
1.0.13|April 28, 2020|Added support for Dynamic Data
|
||||
1.0.14|October 30, 2020|Fixed (lookup-)fields with special characters
|
||||
1.0.15|November 2, 2020|Upgraded to SPFx 1.11; Added support for jsonValue
|
||||
1.0.16|November 14, 2020|Fixed a bug where the fieldname starts with a special character; Added more special characters
|
||||
|
||||
## Disclaimer
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
"solution": {
|
||||
"name": "React Content Query",
|
||||
"id": "00406271-0276-406f-9666-512623eb6709",
|
||||
"version": "1.0.15.0",
|
||||
"version": "1.0.16.0",
|
||||
"isDomainIsolated": false,
|
||||
"includeClientSideAssets": true,
|
||||
"developer": {
|
||||
|
@ -583,10 +583,14 @@ export class ContentQueryService implements IContentQueryService {
|
||||
|
||||
for (let result of results) {
|
||||
let normalizedResult: any = {};
|
||||
let formattedCharsRegex = /_x00(20|3a|e0|e1|e2|e7|e8|e9|ea|ed|f3|f9|fa|fc)_/gi;
|
||||
|
||||
let formattedCharsRegex = /_x00(20|3a|[c-f]{1}[0-9a-f]{1})_/gi;
|
||||
for (let viewField of viewFields) {
|
||||
let formattedName = viewField.replace(formattedCharsRegex, "_x005f_x00$1_x005f_");
|
||||
//check if the intenal fieldname begins with a special character (_x00)
|
||||
let viewFieldOdata = viewField;
|
||||
if (viewField.indexOf("_x00") == 0) {
|
||||
viewFieldOdata = `OData_${viewField}`;
|
||||
}
|
||||
let formattedName = viewFieldOdata.replace(formattedCharsRegex, "_x005f_x00$1_x005f_");
|
||||
formattedName = formattedName.replace(/_x00$/, "_x005f_x00");
|
||||
normalizedResult[viewField] = {
|
||||
textValue: result.FieldValuesAsText[formattedName],
|
||||
|
Loading…
x
Reference in New Issue
Block a user