Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

I get a warning box when pasting a page, but no useful error message

Vote:
 

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?

#44151
Oct 02, 2010 4:15
Vote:
 

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.

#44152
Oct 03, 2010 9:29
Vote:
 

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

#47126
Jan 14, 2011 15:17
Vote:
 

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. 

#47139
Jan 15, 2011 17:06
Vote:
 

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

#47164
Jan 17, 2011 17:28
Vote:
 

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/

#47187
Jan 18, 2011 16:24
Vote:
 

Thanks Seth, I'll give this a try.

Robert

#47289
Jan 21, 2011 17:08
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.