Merge pull request #1601 from Abderahman88/FirstSpecialChar
This commit is contained in:
commit
e82d25092c
|
@ -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": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "react-content-query-webpart",
|
||||
"version": "1.0.12",
|
||||
"version": "1.0.15",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "react-content-query-webpart",
|
||||
"version": "1.0.15",
|
||||
"version": "1.0.16",
|
||||
"private": true,
|
||||
"main": "lib/index.js",
|
||||
"engines": {
|
||||
|
|
|
@ -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…
Reference in New Issue