Skip to content

Service Worker redirect page to error when ID is set don't exist or when List param is set without ID param #9947

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

Open
1 of 9 tasks
Youssef-El-Garmit opened this issue Oct 1, 2024 · 6 comments
Assignees
Labels
Needs: Triage 🔍 Awaiting categorization and initial review. sharepoint-developer-support sharepoint-developer-support type:bug-confirmed Confirmed bug, not working as designed / expected. type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.

Comments

@Youssef-El-Garmit
Copy link

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

💥 SharePoint Framework

Developer environment

Windows

What browser(s) / client(s) have you tested

  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)

Additional environment details

  • browser version
  • SPFx version
  • Node.js version
  • etc

Describe the bug / error

Hello

Issue Summary: When modifying the NewFormUrl in SharePoint Online with a custom URL, the parameters List, Source, and ContentTypeId are automatically appended to the URL when clicking on a new item in the list. However, this results in an error on the new form page because it attempts to retrieve an Item ID that does not exist, likely due to a service worker issue. Additionally, adding an ID parameter to any page URL for custom use also results in an error.

Steps to Reproduce:

Modify the NewFormUrl with a custom URL.
Click on a new item in the list where the content type has been changed.
Observe that the URL includes the parameters List, Source, and ContentTypeId.
Notice the error on the new form page as it tries to fetch a non-existent Item ID.
Add an ID parameter (e.g., ID=23) to any page URL and observe the resulting error.
Expected Behavior: The new form page should load without attempting to retrieve an Item ID, allowing users to create new items without encountering errors. Additionally, adding an ID parameter to any page URL should not result in an error.

Actual Behavior: The new form page displays an error because it tries to get an Item ID that does not exist in the new form context. Similarly, adding an ID parameter to any page URL results in an error.

Additional Information: This issue appears to be related to the service worker handling the request. Any insights or fixes would be greatly appreciated.

Steps to reproduce

1.Add for example ?ID=999999 in any page
2.You will have an error

1.Add a param ?List={PUT HERE REAL LIST GUID} in any page without ID param and you will have an error

Expected behavior

The page should display, so that i can display my custom new form webpart

And in the case of ID, if we are not in the contexte of a list the page should display so that i manage the error my self

@Youssef-El-Garmit Youssef-El-Garmit added the type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs. label Oct 1, 2024
@Youssef-El-Garmit
Copy link
Author

Capture d'écran 2024-10-02 013322 Capture d'écran 2024-10-02 013553

@VesaJuvonen VesaJuvonen added the Needs: Triage 🔍 Awaiting categorization and initial review. label Oct 7, 2024
@Ashlesha-MSFT Ashlesha-MSFT self-assigned this Apr 22, 2025
@Ashlesha-MSFT Ashlesha-MSFT added the sharepoint-developer-support sharepoint-developer-support label Apr 22, 2025
@Ashlesha-MSFT
Copy link

Hello @Youssef-El-Garmit,
Thank you for bringing this issue to our attention. We will look into it and get back to you shortly.

@Ashlesha-MSFT
Copy link

@Youssef-El-Garmit,
Can you please confirm how you are Modifying the NewFormUrl with a custom URL.
Please give us more detailed repro steps

@Youssef-El-Garmit
Copy link
Author

@Youssef-El-Garmit, Can you please confirm how you are Modifying the NewFormUrl with a custom URL. Please give us more detailed repro steps

Hello @Ashlesha-MSFT ,

Of Course i use the pnp js, and here is my code :

list.contentTypes.getById(itemContentTypeList.Id.StringValue).update({DisplayFormUrl: displayFormUrl, NewFormUrl: newFormUrl, EditFormUrl : editFormUrl });

But as i said in the first message, even without modifying the url of redirect it you can reproduce the error just by :

1.Add for example ?ID=999999 in any page
2.You will have an error

1.Add a param ?List={PUT HERE REAL LIST GUID} in any page without ID param and you will have an error

Expected behavior
The page should display, so that i can display my custom new form webpart

And in the case of ID, if we are not in the contexte of a list the page should display so that i manage the error my self

@Youssef-El-Garmit
Copy link
Author

Hello @Ashlesha-MSFT @VesaJuvonen,

Do you have some news about this issue ?

@Ashlesha-MSFT
Copy link

@Youssef-El-Garmit
Apologies for the delayed response, and thank you for your clear explanation.
Image

We were able to reproduce the issue, and we are investigating it. We have logged this as a bug, and our engineering team will look into it.
Thank you for your patience!

@Ashlesha-MSFT Ashlesha-MSFT added the type:bug-confirmed Confirmed bug, not working as designed / expected. label Jun 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Triage 🔍 Awaiting categorization and initial review. sharepoint-developer-support sharepoint-developer-support type:bug-confirmed Confirmed bug, not working as designed / expected. type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.
Projects
None yet
Development

No branches or pull requests

3 participants