Field Control in Page Layout returns SPWeb object has already been disposed error

Mar 24, 2011 at 5:24 PM

I just installed and played around with this. Noticed that GetAvailableValues in Util.cs uses using (SPSite ...) which will dispose the current SPSite (and associated SPWebs). This throws the dreaded "Trying to use an SPWeb object that has been closed or disposed and is no longer valid." and renders this control unusable in Page Layouts (when added as a site column to a content type inheriting from Page content type).

Solution:

Remove the "using" from Util.cs, and replace it simply with:

SPSite s = SPControl.GetContextSite(ctx);

 

Coordinator
Mar 24, 2011 at 6:25 PM

Hi.
We have correct this bug and we have update the current release.
Thanks for your support ! ;)