Sharepoint 2007 - Access Denied when you try to edit
Recently I received an “Access Denied” error when I try to edit the list item in SP 2007.
I found the following solution from here (I coped same text below), which resolved the issue.
Here is the situation:
- In a site collection, you make a new list/document library in any sub-site or the main website.
- You then add a new item/document to the folder, and then attempt to edit the item
- You then see something along the lines of "Access Denied" , even if you are on the system account.
- This happens with every new list you create on any site or subsite.
Specifically the "Effective Permissions Mask" is missing an attribute in it's xml scheme -
RenderXMLUsingPattern="TRUE"
The fix comes in 3 steps:
1. Update your server to the most recent cumulative update package (Service pack 2 or greater). You can get more information about this from the Sharepoint team blog post on SP2. Included in SP2 is a hotfix that prevents this from occurring ever again on any other site collections, but it does not fix sites already effected by it.
2. To fix sites that are already having this problem, first we need to fix the field definition. Thanks to Vicki Dillon who pointed me in the right direction (but the wrong field =) )
The easiest way to accomplish this is to use: sharepoint manager 2007
- Run sharepoint manager 2007 and navigate to the site collection you are having problems with.
- Expand the site collection until you see "Fields"
- Scroll down this long list until you come to "Effective Permissions Mask" (also goes by the static name of PermMask )
- Go to the SchemaXML, copy it out into notepad to wordpad, and add the following value:
- RenderXMLUsingPattern="TRUE"
(I just tacked that onto the end, right before version="1")
This will prevent new lists from being created with out the RenderXMLUSingPatter=True value.
3. Now to fix the lists you already have made that need fixing.. You can either do this using SPmanger or you can do my favored option and fire up visual studio and compile the following code:
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SharePoint;
using System.Xml;
namespace CA_TestingHotfix
{
class Program
{
static void Main(string[] args)
{
FixField(args);
}
static void FixField(string[] args)
{
string RenderXMLPattenAttribute = "RenderXMLUsingPattern";
//Console.WriteLine("Please enter the URL of the site: (Press enter after typing):");
string weburl = args[0];
//Console.WriteLine("Please enter the Document Library Name: (Press enter after typing):");
string listName = args[1];
SPSite site = new SPSite(weburl);
SPWeb web = site.OpenWeb();
SPList list = web.Lists[listName];
SPField f = list.Fields.GetFieldByInternalName("PermMask");
string s = f.SchemaXml;
Console.WriteLine("schemaXml before: " + s);
XmlDocument xd = new XmlDocument();
xd.LoadXml(s);
XmlElement xe = xd.DocumentElement;
if (xe.Attributes[RenderXMLPattenAttribute] == null)
{
XmlAttribute attr = xd.CreateAttribute(RenderXMLPattenAttribute);
attr.Value = "TRUE";
xe.Attributes.Append(attr);
}
string strXml = xe.OuterXml;
Console.WriteLine("schemaXml after: " + strXml);
f.SchemaXml = strXml;
}
}
}
Since this touches the Sharepoint Model directly, remember to add the assembly reference to your local copy of Microsoft.sharepoint.dll to avoid compiling errors. Thanks to Jeff1024 for posting this code he got from the microsoft support team.
Run the program on the local server from the command line with two variables, the first one is the site that the list you are fixing is located in, the second is the name of the list to fix.
SharePoint 2007 – Custom Alert Template Issue
Recently one of our Business user requested to use “Custom Alerts on old SharePoint” even though we are in the process of upgrading to SharePoint 2013.
Anyway I found a nice article to implement “Custom Alert Templates” here. This is what I did, in simple steps.
- Created a copy of “AlertTemplates.xml” found in 12 hive\Templates\XML
- Created a new “AlertTemplate” section with in the XML and gave the unique name (simply copy the GeneraicList and renamed the Name)
- Made couple of changes to Styles and layout (adding new tables to show Company logo)
- Ran the STSADM command to update the template
- Create a small tool in VS to update the template name to specific list
- Reset the IIS
- Reset the SharePoint Timer Service
Even though I followed same as mentioned in the article, still alert emails are defaulting to the old template no matter what i did (Even I made exact changes to generic list section to see at least its falling into that)
After spending couple of days, I removed existing alerts on the list and created new one. Now i see the emails with update template.
I found out that, if we already have alerts setup on the list before updates, even you change the list to use different template (through code), SharePoint still sends alert emails using the template that was assigned to the list at the time of Alert setup.
Lesson learned !!!
Could not find UpdatePanel with ID 'XXXX'. If it is being updated dynamically then it must be inside another UpdatePanel
I working on a project where I need to create a connected web parts in SharePoint. I created these web parts and wrap it in update panels. Also I am using the exception handling, so that if any error occurs in the code, I just clearing all the controls in the update panel and created a label control to show detailed error message. Everything works normally (update contents in each web part) if I do not get any error.
But if I get any error in the code, exception shows without any JavaScript error when page loads. Next I made some changes in the filters and hit submit button, now I am getting the JavaScript error as shown below.
Could not find UpdatePanel with ID 'ctl00_m_g_bcc7da50_1d6b_4979_8186_4246cbd7ca34_udpItemListingWebPart'. If it is being updated dynamically then it must be inside another UpdatePanel
I couldn’t figure it out what was causing this error for couple of hours. I know there is some thing wrong with the update panel and I closely look into the error message. Since error message says “It is being updated dynamically” and I changed the UpdateMode to “Conditional”.
Now It’s working without any JavaScript error. :)
SharePoint 2010 Branding issue with wide content
I tried to branding my master page and everything works great if the page content is not big enough.
But when the page has wide horizontal data, I am having weird issue as show below. Somehow #s4-bodyContainer width is not set to 100%( tried both Min-width and width). Same behavior with default v4.master too.
I found the following hack from the internet to fix the issue.
BODY #s4-bodyContainer
{
display:-moz-inline-stack;
display:inline-block;
zoom:1;
*display:inline;
min-width:100%;
*min-width:100%;
}
This one works very well in IE8 but not in IE7. In IE7, second div pushes down.
I am trying to find any workaround for this issue and if i found any i will update this post.
Update:
02/09/2011 3:29 PM
I tired the Randy Drisgill master page, Real World Branding with SharePoint 2010 and it shows multiple scroll bars if have more data. Check the following screenshots. I feel, this is not user friendly as user has to vertically scroll down and then select horizontal scroll bar to see the data.