Can't edit pages
Hello,
I have following exception after upgrade to RC from Beta2. I can't open any page to edit from back office.
An unhandled exception was generated during the execution of the current
web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.
|
[NullReferenceException: Object reference not set to an instance of an object.] Telerik.Sitefinity.Modules.Pages.DraftProxyBase.GetPageUrlByNodeId(String nodeId) +110 Telerik.Sitefinity.Modules.Pages.DraftProxyBase.get_CancelUrl() +469 Telerik.Sitefinity.Modules.Pages.DraftProxyBase.CreateChildControls(Page page) +1281 Telerik.Sitefinity.Modules.Pages.PageDraftProxy.CreateChildControls(Page page) +42 Telerik.Sitefinity.Web.PageEditorRouteHandler.ApplyLayoutsAndControls(Page page, RequestContext requestContext) +350 Telerik.Sitefinity.Web.RouteHandler.InitializeContent(Page handler, RequestContext requestContext) +333 Telerik.Sitefinity.Web.RouteHandler.Handler_Load(Object sender, EventArgs e) +561 System.Web.UI.Control.OnLoad(EventArgs e) +91 System.Web.UI.Control.LoadRecursive() +74 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207 |
Hello Vitaly,
Could you check the version you used to upgrade your project? If you have used build 4.0.1030.0 to upgrade your project this is not supported upgrade path.
Regards,
Ivan Dimitrov
the Telerik team
Hello Ivan,
Thank you for your help. I've used Build 4.0.992.0 to upgrade.
Hello Vitaly,
Thank you for the additional information.
Can you please check if all of the pages are using the same page template? Also do you get this exception for newly created pages?
Greetings,
Radoslav Georgiev
the Telerik team
I am also getting this error on a brand new build 1210 database when users of certain roles attempt to edit a page. Please help!!!
The page template is a custom masterpage. The roles permitted to edit the page are custom. Administrators can edit the page no problem.
System.NullReferenceException: Object reference not set to an instance of an object.
at Telerik.Sitefinity.Modules.Pages.DraftProxyBase.get_CancelUrl()
at Telerik.Sitefinity.Modules.Pages.DraftProxyBase.CreateChildControls(Page page)
at Telerik.Sitefinity.Modules.Pages.PageDraftProxy.CreateChildControls(Page page)
at Telerik.Sitefinity.Web.PageEditorRouteHandler.ApplyLayoutsAndControls(Page page, RequestContext requestContext)
at Telerik.Sitefinity.Web.RouteHandler.InitializeContent(Page handler, RequestContext requestContext)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Hi Valerie,
What are the permissions to edit the template and to see the place holders for the custom role?
Best wishes,
Radoslav Georgiev
the Telerik team
Radoslav,
The permissions to edit the template were set to "Designers" (a role we do not use). I changed it to "All Backend Users" (a role which all of my custom role users also have) and still see the same result.
I'm not sure I understand the second half of your question: "...and to see the place holders for the custom role?"
-Valerie
Additional notes:
I have also tried giving my users, who are assigned to a custom role and are backend users, permissions to edit a page that uses a standard SF template. They receive the same Sitefinity internal exception when trying to edit a page.
I have also tried upgrading to 4.1.1339. Same exception.
Hi. I work w Valerie and we have this update:
We found a sort of work around. If we put our user in the SF Authors role they can edit the page w o error.
We never had to do this before version 4.1
Before ver 4.1 we had been giving the users role permissions programatically with code like the following, and everything worked fine.
thePermission.GrantActions(true, SecurityConstants.Sets.Pages.Modify);
thePermission.GrantActions(true, SecurityConstants.Sets.Pages.EditContent);
thePermission.GrantActions(true, SecurityConstants.Sets.Pages.Create);
thePermission.GrantActions(true, SecurityConstants.Sets.Pages.CreateChildControls);
thePermission.GrantActions(true, SecurityConstants.Sets.Pages.View);
thePermission.GrantActions(true, SecurityConstants.Sets.Pages.Delete);
Hello Phil,
I tried to reproduce your problem, but to no avail. Both with our latest code version and with the build you specified, 4.1.1339.0.
Here's a detailed list of the steps I took:
I created a custom page template in the system, based on a custom master page.
I created a custom page (named "CustomPage") based on the custom template.
I created a custom role (named "PageEditor") in the system, and a user ("testUser") who is assigned to this custom role (and defined as a backend user).
In order to grant PageEditor role specific permissions on CustomPage, I ran the following code:
01.
void
AddPermissionsToCustomPage()
02.
03.
PageManager pm = PageManager.GetManager();
04.
RoleManager rm = RoleManager.GetManager();
05.
06.
//get the custom page
07.
PageNode customPage = pm.GetPageNodes()
08.
.Where(
09.
node => node.Title ==
"CustomPage"
)
10.
.FirstOrDefault();
11.
12.
//get the custom role
13.
Role pageEditor = rm.GetRole(
"PageEditor"
);
14.
15.
if
(customPage !=
null
)
16.
17.
//make sure permission inheritance for this page
18.
//is broken. Otherwise specific permissions are
19.
//not effective.
20.
pm.BreakPermiossionsInheritance(customPage);
21.
22.
//check if a permission for the custom role already
23.
//exists for this page
24.
Permission pageEditorPermission =
25.
customPage.GetActivePermissions()
26.
.Where(permission =>
27.
permission.PrincipalId == pageEditor.Id)
28.
.FirstOrDefault();
29.
30.
//if the permission doesn't exist,
31.
//we need to created it and attach it to the page
32.
if
(pageEditorPermission ==
null
)
33.
34.
pageEditorPermission = pm
35.
.CreatePermission(
36.
SecurityConstants.Sets.Pages.SetName,
37.
customPage.Id,
38.
pageEditor.Id);
39.
40.
customPage.Permissions.Add(
41.
pageEditorPermission);
42.
43.
//grant the custom role the option to modify
44.
//(or any other desired permission)
45.
pageEditorPermission.GrantActions(
true
,
46.
SecurityConstants.Sets.Pages.EditContent);
47.
48.
//Done.
49.
pm.SaveChanges();
50.
51.
The specified role "Administrators" already exists.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Configuration.Provider.ProviderException: The specified role "Administrators" already exists.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[ProviderException: The specified role "Administrators" already exists.]
Telerik.Sitefinity.Security.Data.OpenAccessRoleProvider.CreateRole(Guid id, String roleName) +447
Telerik.Sitefinity.Web.UI.Backend.AdministratorPane.EnsureRole(RoleDataProvider roles, RoleInfo role) +379
Telerik.Sitefinity.Web.UI.Backend.AdministratorPane.DoWork() +95
Telerik.Sitefinity.Web.UI.Backend.StartupWizard.ProcessWizardStep(InternalWizard wizard, Int32 stepIndex, IStartupWizardStepPane& currentPane) +89
Telerik.Sitefinity.Web.UI.Backend.StartupWizard.wizard_FinishButtonClick(Object sender, InternalWizardNavigationEventArgs e) +84
Telerik.Sitefinity.Web.UI.Backend.InternalWizard.OnFinishButtonClick(InternalWizardNavigationEventArgs e) +92
Telerik.Sitefinity.Web.UI.Backend.InternalWizard.OnBubbleEvent(Object source, EventArgs e) +512
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +121
System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +161
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +12
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +15
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +9997462
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1738
I created earlier 1 project i forgot password and everything. So i tried to create new one getting error, could you please let me know that how and what i want to do. it's very urgent work me live.