Copied to clipboard

Flag this post as spam?

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


  • Anthony 22 posts 42 karma points
    Feb 15, 2011 @ 06:01
    Anthony
    0

    Template problem :( !!...Help please

    Hi All,

    I started to create my Umraco website and it was working fine. I wanted a new template and tried to create it, but it showed a server error and when I cancelled the process, all the other templates also vanished. My document type is also not working, it shows a server error. I am unable to create new templates, even if I do so I cannot see them under the template folder...Kindly someone help me with this issue, I am not able to figure out what is the problem and how to bring back the other templates. 

    Appreciate your help.

    Thank you 
    Anthony.

  • Sascha Wolter 615 posts 1101 karma points
    Feb 15, 2011 @ 06:50
    Sascha Wolter
    0

    Hi Anthony,

    it sounds like some data got corrupted when the error occured, do you have by any chance more details on the server error you've seen? Have a look in the /masterpages directory, is your new template in there? Might be worth a try to move all templates out of that folder and see if that helps (and later on put them back one by one).

    Do you have access to the Umbraco log to find out what might have happened?

    Your best bet in this case though is a server backup from the night before if that is available!

     

  • Anthony 22 posts 42 karma points
    Feb 15, 2011 @ 07:02
    Anthony
    0

    Hi, 

    Thank you for the quick reply, I am getting a runtime error whe I try to access the Document types.

    Also is there any way to view the master templates which I created from the website folder. Where will they actually get stored?...

     

    Thank you,
    Anthony.

  • Sascha Wolter 615 posts 1101 karma points
    Feb 15, 2011 @ 07:07
    Sascha Wolter
    0

    The templates get stored in the /Masterpages directory, they have the alias of the template you've created in Umbraco as name and .master as extension.

    Could you grab a screenshot of the error and post it here?

  • Anthony 22 posts 42 karma points
    Feb 15, 2011 @ 07:30
    Anthony
    0

    Please find below the error,

  • Sascha Wolter 615 posts 1101 karma points
    Feb 15, 2011 @ 07:35
    Sascha Wolter
    0

    Hi Anthony,

    can you please modify the web.config file so we can see the actual error, you need to replace the part it mentions:

    Replace

    <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.html"/>

    with

    <customErrors mode="Off"/>

    You can (and should) later switch that back. Please let me know what you get when you've got the actual error message.

  • Anthony 22 posts 42 karma points
    Feb 15, 2011 @ 09:52
    Anthony
    0

    Hi Sascha,

    Please find below the screenshot of the actual error, which I get when I access the document type and template folders,


  • Sascha Wolter 615 posts 1101 karma points
    Feb 15, 2011 @ 10:24
    Sascha Wolter
    0

    Hi Anthony,

    it looks pretty much like there is an 'illegal' character somewhere. I've googled it a bit and found this information quite enlightening:

    http://www.christophercrooker.com/use-any-characters-you-want-in-your-urls-with-aspnet-4-and-iis

    You could try the registry entry 'hack' as christopher explains, he also writes that it's an official Microsoft thing anyway.

    My guess is that you've added a new document type, gave it a name that asp.net doesn't like and clicked 'create' with the 'also create template' tick box on. That would at least explain why you can't see templates and document types.

    Do you know which name you have given the document type/template?

    If you can't get it to work with the registry entry fom Christopher's blog you will most likely have to dig a bit into the database. Let me know if you could fix the problem or if we need to get down the database route.

    Cheers, Sascha

  • Anthony 22 posts 42 karma points
    Feb 15, 2011 @ 11:13
    Anthony
    0

    Hi Sascha,

    Thank you.

    I also came across the same article, but didn't go through it properly. 

    Yeah, I used space and  '?'  mark's while assigning a name for the template and I am regretting it now.
    I have requested one of my server admins here to check the registry entry. Meanwhile can you please explain me how I can fix it the database way? 

    Appreciate your help.

    Thank you,
    Anthony.

  • Sascha Wolter 615 posts 1101 karma points
    Feb 16, 2011 @ 00:31
    Sascha Wolter
    0

    Hey Anthony,

    before you do anything please make a db backup (if you haven't done so already...)!

    Were you able to locate the template you've created in the /Masterpages folder? If so, delete it (or move it somewhere else).

    I haven't done this myself yet, so no guarantee. ;)

    Let's get rid of the template first:

     

    1. Open your favourite db management tool, e.g. Management Studio
    2. Connect to your database
    3. Look up cmsTemplate, there should be an entry with your template name, remember the [nodeId] value from it
    4. Check if there are any documents created that use this template (there shouldn't be any):  SELECT * FROM cmsDocument WHERE templateId = [nodeId]. If there are set their templateId value to NULL.
    5. Same goes for cmsDocumentType: SELECT * FROM cmsDocumentType WHERE templateNodeId = [nodeId]. Remember the [contentTypeNodeId]! Delete any entries of that you find which have the nodeId as templateNodeId.
    6. Now you can delete the entry in cmsTemplate with the [pk]
    7. Finally we have to delete the entry for that 'node' in the umbracoNode table: SELECT * FROM umbracoNode WHERE id = [nodeId]. 

     

    You should now be able to see the templates in Umbraco again. So let's finish off the document type:

     

    1. Check table cmsContentType: SELECT * FROM cmsContentType WHERE nodeId = [contentTypeNodeId]. Delete all found entries.
    2. And finally delete the doc type from table umbracoNode: SELECT * FROM umbracoNode WHERE id = [contentTypeNodeId].

     

    The Document Types should now be browsable as well in Umbraco!

    Let me know how it goes,

    Sascha

     

Please Sign in or register to post replies

Write your reply to:

Draft