FixTemplateDoesNotExistErrorSnippet

Fix Template Does Not Exist Error Snippet

When I was experimenting with creating pages dynamically, I broke my Main.Webhome! This is caused by an issue when you create a malformed doc. I had used $doc.setDefaultTempate() to try and set the template. this ended up making my main page not show up. to fix this open up you database (following example for mysql), and run the following query:

UPDATE xwikidoc SET XWD_DEFAULT_TEMPLATE = "" WHERE XWD_FULLNAME = "Main.WebHome";

you can also do this using velocity code on a page

{{velocity}}
#set($mainDoc = $xwiki.getDocument("Main.WebHome"))
$mainDoc.setDefaultTemplate("")
$mainDoc.save()
{{/velocity}}
Tags:
Created by Jared Scott on 2010/03/12 17:49
Last modified by Thomas Mortagne on 2010/03/12 18:30

This wiki is licensed under a Creative Commons license
2.3.28624