Copied to clipboard

Flag this post as spam?

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


  • Chris Roberts 74 posts 106 karma points c-trib
    Jul 10, 2013 @ 02:52
    Chris Roberts
    0

    Installation Fails

    Hello,

    I am trying to install the latest version of your package in a clean Umbraco v6.1.2 installation.  I created an empty installation and changed the default view engine to MVC, then attempted to install your package.

    The exception was thrown on the last line of the code below, because root was null. 

    As root is set with a 'FirstOrDefault', surely the case when root is null should be trapped?

    public partial class usercontrols_StandardWebsiteInstall : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            // Find Pages (homepage, etc)
            if (!Page.IsPostBack)
            {

                Umbraco.Core.Services.ContentService contentService = new Umbraco.Core.Services.ContentService();
                Umbraco.Core.Services.FileService fileService = new Umbraco.Core.Services.FileService();
                var root = contentService.GetRootContent().Where(x => x.Name == "Home").FirstOrDefault();
                //Document root = Document.GetRootDocuments().Where(x => x.Text == "Home").FirstOrDefault();
                // Add Public Permissions
                int clientAreaId = -1;
                int loginPageId = -1;
                int errorPageId = -1;
                int contentPanelsId = -1;
                int slideShowId = -1;             root.SetValue("primaryNavigation", root.Id + "");

    Any ideas how I can get around this would be appreciated...

    Thanks,
    - Chris

  • Ben Wyatt 3 posts 23 karma points
    Jul 16, 2013 @ 16:35
    Ben Wyatt
    0

    Hi Chris

    I ran into exactly the same issue installing the starter website over a fresh install of version 6.0.7. I noticed that the package creates a home node called "Home (1)" which I couldn't rename. You never get a "Home" node, and subsequent runs of the package create "Home (2)", "Home 3" etc.

    I got around this by modifying the line in the installation user control to:

    var root = contentService.GetRootContent().Where(x => (x.Name=="Home" || x.Name=="Home (1)").FirstOrDefault();

    I then set the control to readonly in the filesystem to stop the packager overwriting it on the next run and the website installs OK.

    Never really got to the bottom of the problem, but this was good enough to get things up and running.

    Thanks

    Ben

  • Dan 1265 posts 3834 karma points admin c-trib
    Jul 16, 2013 @ 17:47
    Dan
    0

    Hi Ben,

    I believe the 'Home (1)' issue is/was a bug with umbraco core I think when either a document type or template has the alias 'Home'.  I also believe it has been fixed in the nightly builds or maybe latest release.  See details here: http://issues.umbraco.org/issue/U4-2458.

Please Sign in or register to post replies

Write your reply to:

Draft