Pnpjs: Setting Banner Image is not possible when new ClientSidePage is Created in version 1.3.1

Created on 25 Mar 2019  路  2Comments  路  Source: pnp/pnpjs

I just tested the new setBannerImage method. The method works fine for replacing the banner image of a page that already a different image set as the banner image. However, for a newly created page or a page that does not have an initial banner image set the method gives the error message: TypeError: Cannot convert undefined or null to object

I think this might be because we are deleting the below properties in bannerImageUrl method that are undefined initially before a banner image is set:

delete this._layoutPart.properties.webId;
delete this._layoutPart.properties.siteId;
delete this._layoutPart.properties.listId;
delete this._layoutPart.properties.uniqueId;

_Originally posted by @aakashbhardwaj619 in https://github.com/pnp/pnpjs/issues/547#issuecomment-475877421_

code fixed bug

All 2 comments

OK, thanks will have a look.

Fixed this, turns out the guids in the layouts webparts section are constants, not generated as we had first assumed when we reverse engineering the API. Fix will be in #581 and part of 1.3.2 release. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

un-dres picture un-dres  路  3Comments

jcosta33 picture jcosta33  路  3Comments

AJIXuMuK picture AJIXuMuK  路  3Comments

pavan2920 picture pavan2920  路  3Comments

SpliceVW picture SpliceVW  路  3Comments