Skip to content

SPFx Form Customizer - error using env=Embedded URL parameter for SPListForm.aspx #10341

@vlad-nvs

Description

@vlad-nvs

Target SharePoint environment

SharePoint Online

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

💥 SharePoint Framework

Developer environment

None

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

  • SPFx version 1.18.2
  • Node.js version 18.17.1

Describe the bug / error

I`m using SPFx Form customizer to customize the SharePoint list form (https://learn.microsoft.com/en-us/sharepoint/dev/spfx/extensions/get-started/building-form-customizer).

In this case, SharePoint redirects me to the SPListForm.aspx page where I have a few parameters in the URL.

Now, I'm trying to use URL parameter env=Embedded as described here
https://learn.microsoft.com/en-us/microsoft-365/community/query-string-url-tricks-sharepoint-m365#put-nearly-anything-in-sharepoint-into-focused-mode.

And it shows me an error:

Image

Details from the Network show more info:

Image

After debugging of SharePoint scripts, I found out that it fails when trying to render Navigation (window.o365ShellLoadPromise is undefined, and it camsd somwhere from the logic that tries to render SuiteNav):

Image

I think this is because the variable (_isSuiteNavDisabled) that responds to running this code returns false.

Image

And here is the method (I suppose) that sets it

Image

If I manually, during debugging, set _isSuiteNavDisabled to true, then the form renders without errors.

I think this is a bug in a script on SPListForm.aspx because the param env=Embedded should render the form without any navigation and errors.

It would be good if someone could check this, because usage of env=Embedded is officially allowed and should work in such extensions as Form Customizer

Steps to reproduce

  1. Create SPFx with form customizer
  2. Upload it to SharePoint and try to redirect to e.g. NewForm.aspx with param env=Embedded in the URL (https://..../NewForm.aspx?env=Embedded)
  3. SharePoint will redirect to SPListForm.aspx, env=Embedded present in the URL.
  4. Error occurred.

Expected behavior

If env=Embedded used for the form customized with Form Customizer no error should occure on rendering the page

Metadata

Metadata

Assignees

Labels

area:spfx-extensionsCategory: SharePoint Framework Extensionssharepoint-developer-supportsharepoint-developer-supporttype:bug-confirmedConfirmed bug, not working as designed / expected.type:bug-suspectedSuspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions