-
Notifications
You must be signed in to change notification settings - Fork 388
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pnp/spfx-controls-react ListItemAttachments control loads just 2 attachments to list item even though there is more added #1682
Comments
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible. |
Thank you for submitting your first issue to this project. |
Hi @zarovkaHans , this is a possible duplicate of #1644 |
@zarovkaHans The PR to resolve this is now merged and a new beta version will be published in a few minutes. Please let us know if the issue persists. |
hello, thanx for info. I installed the beta release using this command
The attachments issue now seems to be solved. Thanx for that. But it looks like that the update has introduced a new problem which was not there before.. after installing the beta version I am getting the following warnings in gulp serve command (among others)
and this causes PeoplePicker Component to fail in my form and whole form is not loaded. the code seems to break in the file Solutions\WebParts\Request_Creation_Form\node_modules@pnp\spfx-controls-react\lib\services\PeopleSearchService.js at this point
If I comment out the people picker component in my code, all is fine and form loads and works normally (without needed peoplepicker control of course). After the beta version update I have the following dependencies in package.json file
before the update when peoplepicker was working just fine, I had this
I really do not know what may have gone wrong. Any idea please? Many thanx, Jan |
Just FYI, when I roll it back to
all is fine and working just like before (apart from the list attachments of course) |
Thanks for the update, will try to have a look |
Hi, I have another findings about the beta version..maybe it will help in the testing process.. I wanted to rule out the possibility that the error - described above - I was getting with new 3.16.0-beta.6624416 is somehow caused by the structure/code etc. in my current project. So I created a brand new webpart with yo @microsoft/sharepoint command and installed only the new 3.16.0-beta.6624416 version to it. I imported the PeoplePicker like this
and added the component to my react class like this
variable myContext holds the context of the webpart and is of type BaseComponentContext however this is not accepted the the context property of the PeoplePicker with the following error
if I roll back to
all is working perfectly. |
Hi again, one more question I would have. Would it not be possible to include this attachments issue fix in the current 3.15.0 version where people picker also works? Many thanx for considering this. |
Hi @zarovkaHans, I've tested the fix and it's working from my side. Below extract of my package.json file: "dependencies": {
"@fluentui/react": "^7.199.1",
"@microsoft/sp-component-base": "1.17.3",
"@microsoft/sp-core-library": "1.17.3",
"@microsoft/sp-dialog": "1.17.3",
"@microsoft/sp-lodash-subset": "1.17.3",
"@microsoft/sp-office-ui-fabric-core": "1.17.3",
"@microsoft/sp-property-pane": "1.17.3",
"@microsoft/sp-webpart-base": "1.17.3",
"@pnp/spfx-controls-react": "^3.16.0-beta.6643123",
}, However, regarding the PeoplePicker issue, I met this problem if I'm working with a 1.17.4 version of SPFx. Is that your case? |
Hello, my SPFx version is 1.15.2 the fix for List Items Attachments issue works for me also with 3.16.0-beta.6643123 version. |
As a workaround, can you declare the |
Hi, to be honest, that was just a test to see if the people picker is working on the brand new web part with only 3.16.0-beta.6643123 of @pnp/spfx-controls-react installed. In my current solution that really matters and the one I need to get working - see the original post and this comment #1682 (comment) - I do not have peoplepicker context problem. I have this problem when running gulp serve
This causes peoplepicker to crash the whole form - details in the comment above #1682 (comment) here is my package.json content
I also tried to update to SPFx version 1.17.3 but that did not help either. Here is package,json content after the SPFx update
|
Hi again, so, I finally solved it. And this issue can be closed. I am not entirely sure why it started working when I deleted the complete folder with cloned project, removing all installed node_modules etc.
after doing this gulp serve is not showing those warnings anymore and both ListItemAttachments and PeoplePicker control work just fine. Thanx everyone for help! |
Glad to know that you could solve this! I was about to suggest you to clean up the |
What version of PnPjs library you are using
3.x
Minor Version Number
3.18.0
Target environment
SharePoint Framework
Additional environment details
I am creating an SPFx webpart for SharePoint Online
I have installed the following packages (relevant to this issue is just @pnp/spfx-controls-react,I guess)
"@pnp/graph": "^3.18.0",
"@pnp/sp": "^3.17.0",
"@pnp/spfx-controls-react": "3.15.0",
"formik": "^2.4.3",
"moment-timezone": "^0.5.43",
"office-ui-fabric-react": "7.185.7",
"yup": "^1.2.0"
Question/Request
I have an issue with ListItemAttachments control.
I have it in the code like this. Its in the Functional component, inside the Formik component.
I have verified during run time that all needed variables are populated with needed data.
I then have a button which submits the formik form and creates the list item on sharepoint, the code goes like this
Item gets successfully created, object RequestItem.data contains property ID which is populated by the new item ID.
The issue is that once the line
await attachmentsRef.current.uploadAttachments(RequestItem.data.ID); is executed all attachments but two disappear from the ListItemAttachments control and only 2 attachments are save to the item.
in console there are following errors for not loaded items
and when I open the url from the error I get the following (it strangely says that its using the default 'Get' method even though the error in the console says the operation is 'POST')
URL is:
https://tenantURL/sites/app-VisitorRegistration2/_api/web/lists(@listId)/items(@itemId)/AttachmentFiles/add(FileName=@fileName)?@listId=guid%275b309b8c-b40b-4c8d-99a5-7e32d9ede5c9%27&@itemId=82&@fileName=%27Baggerino_jpeg.jpg%27
error message is
Anyone having an idea what could be wrong please?
Thanx, Jan
The text was updated successfully, but these errors were encountered: