Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • atze187 160 posts 215 karma points
    Apr 09, 2010 @ 14:56
    atze187
    0

    Strange behaviour after saving masterpages

    Hi,

    when saving masterpages (a.k.a. templates) after they got deleted from disk I am facing a problem described over at codeplex.

    Any hints? I'm using 4.03 source distribution.

    Cheers,
    André

     

  • Rik Helsen 670 posts 873 karma points
    Apr 09, 2010 @ 15:05
    Rik Helsen
    0

    restore a backup?

    This is where versioning of masterpages (and javascript, css, ...) would come in handy !

     

    You can just copy the contents from the masterpage in the db.cmsTemplate table into a new masterpage that you created using the Umbraco backend. delete the masterpage and create it again (take a backup first, i'm not resonsible if this doesn't work as expected)

     

  • Rik Helsen 670 posts 873 karma points
    Apr 09, 2010 @ 15:06
    Rik Helsen
    0

    There could be an issue with changing nodeId's, so make sure you take backups before you try anything.

  • atze187 160 posts 215 karma points
    Apr 09, 2010 @ 16:08
    atze187
    0

    Hi Rik,

    thanks for your reply, but that is not an option to me, as this sounds like a serious bug. Of course templates won't get deleted that often, but this one is bad. I've looked up the code, but have to do this again tonight.

    Cheers,
    André

  • atze187 160 posts 215 karma points
    Apr 10, 2010 @ 10:57
    atze187
    0

    I didn't took a look at the code again, but gave it a try on a clean machine, that has never seen umbraco before.

    So, this is my master template:

    <%@ Master Language="C#" MasterPageFile="/umbraco/masterpages/default.master" AutoEventWireup="true" %>
    <asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
        <asp:ContentPlaceHolder Id="DefaultContentPlaceHolder" runat="server">
            <!-- Insert default "Level1ContentPlaceHolder" markup here -->
        </asp:ContentPlaceHolder>
    </asp:Content>


    And here is the child template:

    <%@ Master Language="C#" MasterPageFile="/masterpages/Level1.master" AutoEventWireup="true" %>
    <asp:content ContentPlaceHolderId="DefaultContentPlaceHolder" runat="server">
        <umbraco:Item field="metaDescription" runat="server"></umbraco:Item>
    </asp:content>


    After they get deleted from disk, umbraco recreates those in /masterpages/ folder as follows:

    Master template:

    <%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" %>
    <asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
    <%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" %>
    <asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
        <asp:ContentPlaceHolder Id="DefaultContentPlaceHolder" runat="server">
            <!-- Insert default "Level1ContentPlaceHolder" markup here -->
        </asp:ContentPlaceHolder>
    </asp:Content>
    </asp:Content>


    Child template:

    <%@ Master Language="C#" MasterPageFile="~/masterpages/Level1.master" AutoEventWireup="true" %>
    <asp:Content ContentPlaceHolderID="Level1ContentPlaceHolder" runat="server">
    <%@ Master Language="C#" MasterPageFile="/masterpages/Level1.master" AutoEventWireup="true" %>
    <asp:content ContentPlaceHolderId="DefaultContentPlaceHolder" runat="server">
        <umbraco:Item field="metaDescription" runat="server"></umbraco:Item>
    </asp:content>
    </asp:Content>


    I've tried with source and binary (each v4.0.3) distribution, but both behave the same. I guess there are some logical quirks within the code that re-creates the masterpage files first and then writes it to the database (shouldn't it first get saved to db an d then to disk?)

    Cheers,
    André

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies