Is pagetype of Page A allowed to create under Page B's pagetype?
Go to admin mode -> page types -> settings for Page B's pagetype and see which page types are allowed to create beneath Page B.
Just bumping this, I have the same issue. Page A is allowed under Page B's page type and the page does actually copy, but I still get the error message mentioned above.
Any ideas?
Robert
Can you reproduce with the debugger running? If you're using a custom base page and missing any spot where a null reference might occur it can cause this issue.
I believe that was the solution for Deane's original issue, but it was a problem that only reproduced itself once I copied the client's database down to our environment.
Hi Seth,
I'm just inheriting the standard EPiServer.TemplatePage, I'm gussing this should just be out of the box functionality so I'm at a loss as to what's causing this error.
Do you think it could be something in the code behind of my template. That would indicate that when you run the copy/paste command EPiServer executes the Page_Load method in the code behind, do you know if that's the case?
Thanks,
Robert
I don't believe any of the template events fire during a copy/paste, as far as I can tell they don't.
Code that binds to page creating/loading/etc events would still occur. If you want to step through your page copy with the visual studio debugger you could just add a temporary .cs file in with contents similar to below.
using EPiServer;
namespace Blend.EPiFiles
{
public class BindEvents : PlugInAttribute
{
public static void Start()
{
DataFactory.Instance.LoadedPage += pageEvent;
DataFactory.Instance.SavedPage += pageEvent;
DataFactory.Instance.PublishedPage += pageEvent;
DataFactory.Instance.CreatedPage += pageEvent;
DataFactory.Instance.LoadingPage += pageEvent;
DataFactory.Instance.CreatingPage += pageEvent;
}
private static void pageEvent(object sender, PageEventArgs e)
{
throw new NotImplementedException();
}
}
}
Put set a breakpoint on whatever event is appropriate and step through from there through page creation.
Another nice option for tracking exceptions that may be occurring is a Elmah: http://code.google.com/p/elmah/
Whenever my client tries to copy (or cut) and paste a page, he gets this error (as a JS pop-up):
Failed to copy the page "Page A" beneath the page "Page B".
This comes back from an AJAX call via JSON, so there's really no other error message to go on. I RDP'd to the server and checked the Event Log, but there's nothing there as well.
Is there any way to get a relevant error message out of the system regarding why it won't allow the paste?