3.1.2 Update producing Javascript errors on code that was already working
I updated Forms Designer to 3.1.2 when prompted today to update a NEW form that has extensive javascript on it. I made no changes to the javascript, but now I am getting errors.
The error reads:
Uncaught TypeError: Cannot read property 'get_current' of undefined
at isCurrentUserInGroup (fd_Item_NewForm.aspx:578)
at HTMLDocument.<anonymous> (fd_Item_NewForm.aspx:645)
at j (plumsail.fd.jquery.js:1)
at Object.fireWith [as resolveWith] (plumsail.fd.jquery.js:1)
at Function.ready (plumsail.fd.jquery.js:1)
at HTMLDocument.J (plumsail.fd.jquery.js:1)
The error reads:
Uncaught TypeError: Cannot read property 'get_current' of undefined
at isCurrentUserInGroup (fd_Item_NewForm.aspx:578)
at HTMLDocument.<anonymous> (fd_Item_NewForm.aspx:645)
at j (plumsail.fd.jquery.js:1)
at Object.fireWith [as resolveWith] (plumsail.fd.jquery.js:1)
at Function.ready (plumsail.fd.jquery.js:1)
at HTMLDocument.J (plumsail.fd.jquery.js:1)
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Hi,
Make sure that you wrapped your code into the following:
Make sure that you wrapped your code into the following:
Code: Select all
SP.SOD.executeOrDelayUntilScriptLoaded((function () {
// your code here
}), 'SP.js');
I'm a little confused by this.
I have the exact same code on another list that is executing as expected, yet it was saved using the previous version of Forms Designer.
Is there something different about the new version that requires this wrapper to work? If so, I am going to have to add this wrapper to each segment of already working code if I ever want to make edits to those forms.
I have the exact same code on another list that is executing as expected, yet it was saved using the previous version of Forms Designer.
Is there something different about the new version that requires this wrapper to work? If so, I am going to have to add this wrapper to each segment of already working code if I ever want to make edits to those forms.
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Nothing has change in this part of JS-framework. Without wrapping, the code works intermittently depending on whether sp.js is already loaded. Even in our very old sample, you can find the executeOrDelayUntilScriptLoaded function:
http://spform.com/forms-designer- ... point-2010
http://spform.com/forms-designer- ... point-2010
-
- Information
-
Who is online
Users browsing this forum: No registered users and 3 guests