pnp / pnpjs

Fluent JavaScript API for SharePoint and Microsoft Graph REST APIs
https://pnp.github.io/pnpjs/
Other
763 stars 304 forks source link

Fix: fromAbsolutePath methods reference undefined `this` #2857

Closed RoelVB closed 10 months ago

RoelVB commented 11 months ago

Category

Related Issues

No related issue.

When creating a File/Folder object based on the absolute path you would get the error: Cannot read property '_url' of undefined, because the init value here would be undefined: https://github.com/pnp/pnpjs/blob/e62c30d92b8e6cae63baac8cd3fcd3f391c2dcc2/packages/queryable/queryable.ts#L80-L81

What's in this Pull Request?

The methods fileFromAbsolutePath/folderFromAbsolutePath now use the base argument

patrick-rodgers commented 10 months ago

Thanks for submitting this fix! Can't believe no one caught it before, appreciate you taking the time to create the PR. Fix will go out in tonight's nightly build as well as the release planned for Jan 15th.

Thank you!