pnp / pnp/sp-dev-fx-controls-react
Impossible to edit list item using <DynamicForm>
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 433
- Forks
- 418
- Avg merge
- 5d 6m
- Merged PRs (30d)
- 19
Description
Impossible to edit list item using . When a valid listItemId is provided, I have errors.
Category
[ ] Enhancement
[x] Bug
[ ] Question
Version
Please specify what version of the library you are using: [ @pnp/spfx-controls-react": "^3.23.0 ]
Expected / Desired Behavior / Question
Load an item and edit it into
Observed Behavior
When the listItemId props is used, it tries to load the list by id using the _api relative to SitePages in place of using the subsite. 404
It goes to:
https://tenant.sharepoint.com/sites/section/subsite/SitePages/_api/web/lists('548fa362-373c-4e9f-ac05-e2acc942efca')/items(1)
but should go to:
https://tenant.sharepoint.com/sites/section/subsite/_api/web/lists('548fa362-373c-4e9f-ac05-e2acc942efca')/items(1)
I was not able to create a page directly in https://tenant.sharepoint.com/sites/section/subsite
webAbsoluteUrl seems to not be used at all when listItemId is provided.
Steps to Reproduce
WebParts using in a modern page located in a SitePages folder
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the DynamicForm handling of listItemId and webAbsoluteUrl, then reproduce the issue in a modern page located in a SitePages folder. Verify that loading an item uses the subsite’s _api path rather than the SitePages path, and that the item can then be loaded and edited.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- api, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100