re: version and forms (newform.aspx) bug?

Apr 14, 2009 at 8:42 PM
Edited Apr 14, 2009 at 8:52 PM

I saw love_moss_not's "bug report", but perhaps he/she could have been a bit more clear and less sarcastic ^.^
Regardless, I also ran into the same problem but I worked around it by making the following code changes.

In FilteredLookUpField.cs line 257
   Before: using (SPWeb w = SPContext.Current.Site.OpenWeb(LookupWebId)) {
   After: SPWeb w = SPContext.Current.Site.OpenWeb(LookupWebId);

Although it makes a lot of sense to use "using" for some reason while using SharePoint designer, it will
throw an error telling me that SPWeb has been disposed.

Also in Utils.cs
I had to do something similar (lines 28 and 31). Otherwise, modified versions of  NewForm.ASPX will
fail with SPWeb disposed errors.

Hopefully the author will comment on this. 


If you want to reproduce the error,

  1. Start Microsoft SharePoint Designer
  2. Open the site you want to test with
  3. Go to the list folder and select a list that uses the filtered column
  4. Open NewForm.aspx
    1. Right click on "WebPartPages:ListFormWebPart"
    2. Select WebPart Properties
    3. An error will follow
Apr 15, 2009 at 9:02 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Apr 15, 2009 at 9:04 AM
Edited Apr 15, 2009 at 7:27 PM
Thanks a lot for this; it's always appreciated when any issues/discussions raised also contain descriptive steps on how to reproduce the problems.

I'm slightly worried leaving too many undisposed objects lying in memory, as these would surely have some performance impact.

Having said that, I'll see how to cater for use of the filtered lookup field from SPD.