Bugfix retrieving fields from SitePages
This commit is contained in:
parent
1d84d9a023
commit
0e9ea54d0a
|
@ -49,6 +49,7 @@ Version|Date|Comments
|
|||
-------|----|--------
|
||||
1.0.0|March 30, 2021|Initial release
|
||||
1.0.1|September 22, 2021|Added support for multi-language sites
|
||||
1.0.2|December 24, 2021|Fix retrieving fields from SitePages
|
||||
|
||||
## Minimal Path to Awesome
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"solution": {
|
||||
"name": "Advanced Page Properties",
|
||||
"id": "daae06a2-8599-445c-93c0-3bd739305f56",
|
||||
"version": "1.0.1.0",
|
||||
"version": "1.0.2.0",
|
||||
"includeClientSideAssets": true,
|
||||
"isDomainIsolated": false,
|
||||
"developer": {
|
||||
|
|
|
@ -68,7 +68,7 @@ export default class AdvancedPagePropertiesWebPart extends BaseClientSideWebPart
|
|||
|
||||
private async getPageProperties(): Promise<void> {
|
||||
Log.Write("Getting Site Page fields...");
|
||||
const list = await sp.web.lists.ensureSiteAssetsLibrary();
|
||||
const list = await sp.web.lists.ensureSitePagesLibrary();
|
||||
const fi = await list.fields();
|
||||
|
||||
this.availableProperties = [];
|
||||
|
|
|
@ -42,9 +42,9 @@ const AdvancedPageProperties: React.FunctionComponent<IAdvancedPagePropertiesPro
|
|||
|
||||
// Get the value(s) for the field from the list item itself
|
||||
var allValues: any = {};
|
||||
const siteAssetsList = await sp.web.lists.ensureSitePagesLibrary();
|
||||
const sitePagesList = await sp.web.lists.ensureSitePagesLibrary();
|
||||
if (props.context.pageContext.listItem !== undefined && props.context.pageContext.listItem !== null) {
|
||||
allValues = await siteAssetsList.items.getById(props.context.pageContext.listItem.id).select(...props.selectedProperties).get();
|
||||
allValues = await sitePagesList.items.getById(props.context.pageContext.listItem.id).select(...props.selectedProperties).get();
|
||||
}
|
||||
|
||||
for (let i = 0; i < props.selectedProperties.length; i++) {
|
||||
|
@ -53,7 +53,7 @@ const AdvancedPageProperties: React.FunctionComponent<IAdvancedPagePropertiesPro
|
|||
Log.Write(`Selected Property: ${prop}`);
|
||||
|
||||
// Get field information, in case anything is needed in conjunction with value types
|
||||
const field = await siteAssetsList.fields.getByInternalNameOrTitle(prop)();
|
||||
const field = await sitePagesList.fields.getByInternalNameOrTitle(prop)();
|
||||
|
||||
// Establish the values array
|
||||
var values: any[] = [];
|
||||
|
|
Loading…
Reference in New Issue