Copied to clipboard

Flag this post as spam?

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


  • Martin Griffiths 826 posts 1269 karma points c-trib
    May 07, 2014 @ 13:05
    Martin Griffiths
    0

    More problems with syncing templates

    Hi Kevin

    I could really do with your help on this one!

    I have a project i'm upgrading from Umbraco 4.11 to 7.1, I've added uSync to each node. The umbraco 4 build is a staging build on a server, while the Umbraco 7 build is my local dev build running from VS2012 in IISExpress.

    When I copy the uSync XML created on staging and drop it onto my dev build, initially everything looks ok. Until I take a look at the templates.

    The homepage master isnt being recognised properly and every child template is being created in the root of the template folder. The whole thing ends up flat.

    After a look at the logs I can see the following error...

    INFO  Umbraco.Core.Services.PackagingService - [Thread 19] Template 'ContactUsPage' has an invalid Master 'Content', so the reference has been ignored.

    Its doing this for every child template of the master.

    I've checked very carefully my templates are correct, I noticed a few missed ID's here and there, but the .net parser doesn't seem too fussed about these. I added them in, just in case the PackagingService IS fussy. I also made sure there were no conflicting ID names. The only other thing to note is the change in Template casing, sometimes its pascal case sometimes not, but i really cannot see why it would be a problem?

    Any ideas?

    Kind regards

    Martin

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    May 07, 2014 @ 13:42
    Kevin Jump
    0

    Hi Martin,

    I was just wondering about how migrations might work with usync, so its interesting to see you having a go - sorrty it's not working.

    as far as i can tell, the error happens when xml file doesn't contain a <Master> element. Now on a v7.1.1 install my usync files are not getting the master written out. I thought this might be because the templates are mvc - but i've just gone back to a umbraco 6.1.6 build and for mvc and webforms the master is being written into the files.

    So i currently don't know why the master might be missing : (

    but the hand fix is to add a

    I'm looking into it - but this might be the straw that breaks the camels back.

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    May 07, 2014 @ 14:15
    Kevin Jump
    0

    Hi still looking,

    even when you have the Master value in the xml file you will still get

    INFO  Umbraco.Core.Services.PackagingService - [Thread 19] Template 'ContactUsPage' has an invalid Master 'Content', so the reference has been ignored.
    

    This is the package service actually saying the import file it is looking at doesn't contain the master 'Content' because usync passes it a single xml file for each template

    During 'normal' packaging it gets a single file with all templates in it - the INFO is the package service saying I am not adding a dependency for 'Content' because i don't know what it is. during a package import it works on dependencies to make sure it creates them in the right order -

    Usync uses the folder structure to ensure its done packages at the root before it does the child ones - so i think we can ignore this error (as long as we have

    later in the package code - the template 'should' be imported underneath the correct template as usync should have already created the master template at the start. - if you have

  • Martin Griffiths 826 posts 1269 karma points c-trib
    May 07, 2014 @ 14:33
    Martin Griffiths
    0

    Hi Kevin

    Thanks for being so prompt in getting back to me.

    I've had a look at the XML uSync generates and the folder structure looks like this...

    uSync -> Template -> Content -> def.config (Content master)

    The child templates sit below Content, so I have....

    Content -> ContactUsPage -> def.config

    etc etc

    So it looks completely sound at file level.

    Onto the XML itself

    The start of the Content master looks like this...

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <Template>
    <Name>Content</Name>
    <Alias>Content</Alias>
    <Design><![CDATA[<%@ Master Language="C#" MasterPageFile="~/umbraco/masterpages/default.master" AutoEventWireup="true" %>....
    The start of a sample child ie ContactUsPage looks like this...
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <Template>
    <Name>Contact Us Page</Name>
    <Alias>ContactUsPage</Alias>
    <Master>Content</Master>
    <Design><![CDATA[<%@ Master Language="C#" MasterPageFile="~/masterpages/Content.master" AutoEventWireup="true" %>
    <asp:Content id="ContactUsPage" ContentPlaceHolderID="cpcontent" runat="server">...
    So as you can see all looks good, well to me anyway.
    Any ideas?
    Martin.
  • Martin Griffiths 826 posts 1269 karma points c-trib
    May 07, 2014 @ 16:40
    Martin Griffiths
    0

    Hi Kevin

    I've done some further testing in my local v7.1.1 build.

    I took the templates down to a simple master parent and child with nothing else in the folder. I set the relationships up and then forced uSync to export in the dashboard. Sadly absolutely no sign of any folder structure and both files were written into the root of the Templates folder! Interestingly the XML files are named the same as the templates (instead of def.config) and they also include a hash at the bottom of the XML.

    This either means theres some bugs and/or changes in the packaging service in u7 or something isnt quite right in uSync for u7?

    I'm going to try the same with Razor templates and see if I get the same results.

    Kind regards

    Martin

  • Martin Griffiths 826 posts 1269 karma points c-trib
    May 07, 2014 @ 16:47
    Martin Griffiths
    0

    Hi Kevin

    It's flat as a pancake exporting Razor templates from u7 too! ARGGH!

    I guess all I can do is leave it with you to investigate.

    All the best

    Martin

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    May 07, 2014 @ 17:19
    Kevin Jump
    1

    yeah - I am looking into the exportyness from v7.1.1 i think i have figured that bit out - if umbraco doesn't tell me about the master i am going oldscholl back to the v4.x api and getting it.

    Still looking at importing, it doesn't seem to be playing ball at the moment.

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    May 07, 2014 @ 18:28
    Kevin Jump
    1

    OK - I've lot the will to live trying to understand why the core isn't updating the master template on import - it's probibly something really simple but i can't see it.

    I have put pre/port import/export hacks into the v7.1 version of usync to get and set the master and this appears to be working.

    uSync 2.2.6 for Umbraco 7.1

    this will import templates and then set the master on them, so in the log you might see.

    INFO  Umbraco.Core.Services.PackagingService - [Thread 44] Template 'SiteDesign' has an invalid Master 'MasterView', so the reference has been ignored.
    INFO  jumps.umbraco.usync.uSync - [Thread 44] uSync has stepped in and set the master to MasterView
    

    if you try this version it might work - fingers crossed.

  • Martin Griffiths 826 posts 1269 karma points c-trib
    May 07, 2014 @ 18:35
    Martin Griffiths
    0

    Hi Kevin

    Thanks very much for looking into this so quickly, i'll test it first thing tomorrow and let you know.

    My other issue in u7 is Contour related. I dont know if you use Contour but the code first feature seems to be dropping fields somewhere around v3.0.12 and is affecting all versions of umbraco it runs on....problem for me is u7 support came after! So I have a heap of code first forms with holes in...DOH!

    It's been reported for some time, with sadly little feedback from Tim (which is very unlike him).

    Other than that my path to umbraco 7 has been fairly smooth!

    M.

  • Martin Griffiths 826 posts 1269 karma points c-trib
    May 08, 2014 @ 13:13
    Martin Griffiths
    0

    Hi Kevin

    That's fixed it for me, template heirarchy is correct and present. Import is slower than before but at least it works.

    Thanks a lot for your efforts.

    Kind regards

    Martin

  • Kevin Jump 2310 posts 14695 karma points MVP 7x c-trib
    May 08, 2014 @ 13:20
    Kevin Jump
    0

    Yes i suspect the import will be slower - once the templates have been saved inside umbraco they will generate the hash values on the file which will mean usync will start to skip them at startup (until the hash value on disk is different that that from the DB - so the quickest way to speed it up is save the templates.

    I would recommend that once you have done your v4 import (and you think it works) - delete the uSync folder and restart the site - uSync will then write everything out to disk using the latest format - this will speed up start up times. (or just turn it all off if you don't need usync once you've done the initial import)

Please Sign in or register to post replies

Write your reply to:

Draft