Copied to clipboard

Flag this post as spam?

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


  • Marc-Anthony Taylor 55 posts 68 karma points
    Dec 14, 2012 @ 12:52
    Marc-Anthony Taylor
    0

    helper.Request("nodeType") == null???

    Can anyone help? When I create a node I am getting this exception( I am using an adapted create content).

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Dec 15, 2012 @ 12:50
    Jan Skovgaard
    0

    Hi Marc-Anthony

    Could you provide some details on what Umbraco version you're experiencing this on? Is it a new installation or has it been running for a while? Has the installation recently been upgraded? Have any custom modification been made etc.?

    Looking forward to hearing from you.

    /Jan

  • Marc-Anthony Taylor 55 posts 68 karma points
    Dec 15, 2012 @ 14:22
    Marc-Anthony Taylor
    0

    Hi Jan,

     

    Thanks for the reply. I am using 4.9 and it has been running for a while. The problem is actually with my own adaption of the create content context menu (I am setting it up to give the option of creating duplicate content for different languages).

    I have basically replicated the content of the original I am getting this exception:

    Line100:        if(!Page.IsValid)
    Line101:            return;
    Line102:        BasePage.Current.ClientTools.ChangeContentFrameUrl(dialogHandler_temp.Create(helper.Request("nodeType"),
    Line103:                                                                                     int.Parse(nodeType.SelectedValue),
    Line104:                                                                                     int.Parse(Request["nodeID"]),
  • Marc-Anthony Taylor 55 posts 68 karma points
    Dec 15, 2012 @ 14:23
    Marc-Anthony Taylor
    0

    Sorry, the exception is a nullreferenceexception and occurs at line102.

  • Marc-Anthony Taylor 55 posts 68 karma points
    Dec 16, 2012 @ 12:31
    Marc-Anthony Taylor
    0

    ok, so the helper.request isn't null. I put all the parameters of the "dialogHandler_temp.Create" into variables and they all seem to have the correct values. When I try to create the content however I am told that there is no instance of the object. I am lost as to how to sort this.

     

    private void DoCreation()

        {

            if (!Page.IsValid)

                return;

     

            var hel= helper.Request("nodeType");

            var nType = int.Parse(nodeType.SelectedValue);

            var nId = int.Parse(Request["nodeID"]);

            var rName = rename.Text;

     

            BasePage.Current.ClientTools.ChangeContentFrameUrl(dialogHandler_temp.Create(hel,nType,nId,rName)).CloseModalWindow();

        }           

     

  • Marc-Anthony Taylor 55 posts 68 karma points
    Dec 17, 2012 @ 10:23
    Marc-Anthony Taylor
    0

    So, it is the current page that is for some reason null. I take it I need to assign the current page a value but I have no idea where to start.

  • Marc-Anthony Taylor 55 posts 68 karma points
    Dec 17, 2012 @ 10:57
    Marc-Anthony Taylor
    0

    Ok so I sorted the BasePage.Current being null but now it is the:

    dialogHandler_temp.Create(hel,nType,nId,rName)

    I tried creating a new instance but the create method is static.

     

  • Marc-Anthony Taylor 55 posts 68 karma points
    Dec 17, 2012 @ 10:59
    Marc-Anthony Taylor
    0

    Sorry BasePage.Current was sorted by inheriting from "UmbracoEnsuredPage" instead of just page

  • Marc-Anthony Taylor 55 posts 68 karma points
    Dec 17, 2012 @ 17:44
    Marc-Anthony Taylor
    0

    I sorted the problem. See my other question.

  • 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