Copied to clipboard

Flag this post as spam?

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


  • Anthony Candaele 1197 posts 2049 karma points
    Oct 18, 2013 @ 10:07
    Anthony Candaele
    0

    Value cannot be null. Parameter name: umbracoContext

    Hi,

    I just created a url redirect with URL Tracker:

    enter image description here

    However, when I enter the old url in the browser, I'm getting this ysod:

    enter image description here

    I'm using version 2.2.3 of URL Tracker. My Umbraco install is v6.1.5

    greetings,

    Anthony

  • Stefan Kip 1606 posts 4098 karma points c-trib
    Oct 18, 2013 @ 10:12
    Stefan Kip
    0
  • Anthony Candaele 1197 posts 2049 karma points
    Oct 18, 2013 @ 10:19
    Anthony Candaele
    0

    Hi Stefan,

    Yes, but that was due to a missing querystring. Now I don't have a querystring, the url that needs to be redirected is just: http://www.cjs.ugent.be/about_us.html

  • Anthony Candaele 1197 posts 2049 karma points
    Oct 18, 2013 @ 10:39
    Anthony Candaele
    0

    To be sure, I downloaded a fresh Umbraco 6.1.5 install and copied all dll starting with umbraco.xxxxx to the bin folder of my website, but it didn't solve the issue.

  • Stefan Kip 1606 posts 4098 karma points c-trib
    Oct 18, 2013 @ 17:09
    Stefan Kip
    1

    Well this is freaky...
    I'm running the UrlTracker on one of my v6.1.6. sites fine. But I've installed it in a clean 6.1.6. instance and I got the same exception as you.
    I haven't got a clue how this can happen, maybe after this weekend. I'll call in help from Shannon too via Twitter, maybe he knows what's happing.

  • Stefan Kip 1606 posts 4098 karma points c-trib
    Oct 18, 2013 @ 17:20
    Stefan Kip
    1

    Here's the clean install with the UrlTracker and one entry: https://mega.co.nz/#!x1xlSDRQ!ALQxW1ZxULrqsFzkQ5KWukp184FNo86uS1a7TpxAo
    The DB is included as SQL 2008 R2 backup in "App Data" (Umb615.bak).
    The connection string needs updating too ofcourse ;-)
    If you visit the URL of the entry (/about_us.html) you'll see the error.

  • Shannon Deminick 1510 posts 5195 karma points hq
    Oct 21, 2013 @ 02:05
    Shannon Deminick
    1

    The problem is that this request is for an ".html" page

    To save on a lot of processing when running integrated mode, we check: uri.IsClientSideRequest() which includes these files:

    var toIgnore = new[] { ".js", ".css", ".ico", ".png", ".jpg", ".jpeg", ".gif", ".html", ".svg" };

    In which case we do not create an UmbracoContext or attempt to process the request as if it is part of Umbraco 

  • Stefan Kip 1606 posts 4098 karma points c-trib
    Oct 21, 2013 @ 11:24
    Stefan Kip
    100

    Thanks for the clarification Shannon.
    I've release version 2.2.6, which should fix this issue. Could you try that version Anthony?

    For reference, this is the code I've added for filling the UmbracoContext.Current when empty:

    if (!_umbracoAssemblyInitialized)
    {
        IEnumerable<Assembly> umbracoCoreAssemblies = AppDomain.CurrentDomain.GetAssemblies().Where(x => x.FullName.StartsWith("umbraco, "));
        if (umbracoCoreAssemblies != null && umbracoCoreAssemblies.Any())
            _umbracoAssembly = umbracoCoreAssemblies.OrderByDescending(x => x.ImageRuntimeVersion).First();
    }
    if (_umbracoAssembly != null)
    {
        Type umbracoContextType = _umbracoAssembly.GetType("Umbraco.Web.UmbracoContext");
        if (umbracoContextType != null)
        {
            object umbracoContextCurrent = umbracoContextType.GetProperty("Current").GetValue(null, null);
            if (umbracoContextCurrent == null)
            {
                MethodInfo ensureContextMethod = umbracoContextType.GetMethod("EnsureContext", new Type[] { typeof(HttpContextBase), typeof(ApplicationContext) });
                if (ensureContextMethod != null)
                    ensureContextMethod.Invoke(null, new object[] { new HttpContextWrapper(HttpContext.Current), ApplicationContext.Current });
            }
        }
    }
    
    _umbracoAssemblyInitialized = true;
    
  • Anthony Candaele 1197 posts 2049 karma points
    Oct 21, 2013 @ 11:38
    Anthony Candaele
    0

    Hi Stefan,

    Ok, I'll install Url Tracker 2.2.6 and let you know if it solved the problem.

    Thanks for looking into this,

    Anthony

  • Anthony Candaele 1197 posts 2049 karma points
    Oct 21, 2013 @ 13:29
    Anthony Candaele
    0

    Hi Stefan,

    I installed Url Tracker 2.2.6 on my local machine.

    Then I created the redirect for about_us.html

    enter image description here

    when I go to http://localhost/aboutus.html, I'm getting a blank page, with in the address bar the url: http://localhost/aboutus.html

  • Stefan Kip 1606 posts 4098 karma points c-trib
    Oct 21, 2013 @ 13:52
    Stefan Kip
    0

    That's weird, have you checked the logs?

  • Anthony Candaele 1197 posts 2049 karma points
    Oct 21, 2013 @ 14:19
    Anthony Candaele
    0

    I just add:

    <add key="urlTracker:enableLogging" value="true" />
    

    to the web.config of my local site

    Then I browsed to

    "http://localhost/about_us.html
    

    and now it redirected to

    http://localhost/about_us.aspx
    

    maybe it was a cache thing :)

    I'll install Url Tracker 2.2.6 on my production machine now. Can I just install it over my existing install of Url Tracker ?

  • Stefan Kip 1606 posts 4098 karma points c-trib
    Oct 21, 2013 @ 14:20
    Stefan Kip
    0

    Sure, upgrade information is available on the project's page.

    Ps. Could you mark this topic as resolved? Ty!

  • Anthony Candaele 1197 posts 2049 karma points
    Oct 21, 2013 @ 14:27
    Anthony Candaele
    0

    sure, I just upgraded to Url Tracker 2.2.6. Is it normal that the installation wizzard says

    "Previous version checked successfully"
    

    and then

    "Previous version not found"
    

    enter image description here

  • Anthony Candaele 1197 posts 2049 karma points
    Oct 21, 2013 @ 14:29
    Anthony Candaele
    0

    redirect to about_us.html on the production server is working now !

  • Stefan Kip 1606 posts 4098 karma points c-trib
    Oct 21, 2013 @ 14:34
    Stefan Kip
    1

    Yes, with previous version I mean the 301 URL Tracker.
    I might change make it a bit more clear in the future :-)

  • Peter 89 posts 160 karma points
    Nov 27, 2013 @ 13:42
    Peter
    0

    Hey guys, 

    I am running umb 6.1.6 with 301 tracker 2.3.1 and getting the same problem as outlined in this thread. I am trying to redirect a  .html file to a node :-/

    Any thoughts? have I miss read something? 

    Thanks,

    Peter

  • Stefan Kip 1606 posts 4098 karma points c-trib
    Dec 02, 2013 @ 13:06
    Stefan Kip
    0

    Yeah my fix wasn't compatible with umbraco v4, so I had to remove it.
    Haven't had the time to look into this again unfortunately, but the good news is; I do have ideas and code examples to fix this, so it will get fixed any time soonish.

  • Peter 89 posts 160 karma points
    Dec 02, 2013 @ 13:09
    Peter
    0

    OK cool, thanks :) 

    ...and sorry I prompted you for a response via Twitter :-/ 

    ta!

    P

  • Stefan Kip 1606 posts 4098 karma points c-trib
    Dec 02, 2013 @ 13:15
    Stefan Kip
    0

    No problem, like I said; I've missed the notification mail from Our :-)

  • Laurence Gillian 597 posts 1214 karma points
    Dec 10, 2013 @ 12:10
    Laurence Gillian
    0

    What's the best way to handle redirects on HTML pages in Umbraco 6.1.6 currently? Is this possible? Thanks :) Laurence

  • Stefan Kip 1606 posts 4098 karma points c-trib
    Dec 10, 2013 @ 12:11
    Stefan Kip
    0

    @Laurence
    I don't understand your question...

  • Laurence Gillian 597 posts 1214 karma points
    Dec 10, 2013 @ 12:17
    Laurence Gillian
    0

    Hey!

    I'm getting the same error as mentioned earlier in this post.

    When trying to handle a page with a *.html extension, it looks like the UmbracoContext.Current is empty. Shannon mentioned that *.html are ignored by Umbraco by default.

    I'm running 2.3.1.

    -

    Exception information: 
    Exception type: ArgumentNullException 
    Exception message: Value cannot be null.
    
    Parameter name: umbracoContext
    at Umbraco.Web.UmbracoHelper..ctor(UmbracoContext umbracoContext)
    at umbraco.library.NiceUrl(Int32 nodeID)
    at InfoCaster.Umbraco.UrlTracker.Modules.UrlTrackerModule.context_EndRequest(Object sender, EventArgs e) 
    in c:\Users\kipusoep\Documents\GitHub\UrlTracker\Modules\UrlTrackerModule.cs:line 128
    at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
    
  • Stefan Kip 1606 posts 4098 karma points c-trib
    Dec 10, 2013 @ 12:17
    Stefan Kip
    0

    Ah okay, still have to fix it...

  • Stefan Kip 1606 posts 4098 karma points c-trib
    Dec 11, 2013 @ 14:23
    Stefan Kip
    1

    It's fixed in v2.4.0, just released it! :-)

  • Laurence Gillian 597 posts 1214 karma points
    Dec 12, 2013 @ 13:30
    Laurence Gillian
    0

    Awesome! I owe you a beer :-) do you have an Amazon Wishlist? I'd happily buy you a book, etc!

  • Stefan Kip 1606 posts 4098 karma points c-trib
    Dec 12, 2013 @ 13:33
    Stefan Kip
    0

    @Laurence
    There's no need to buy me anything :-) A virtual beer, or a real one when we meet again ;-) is fine!

  • Laurence Gillian 597 posts 1214 karma points
    Dec 13, 2013 @ 14:07
    Laurence Gillian
    0

    Awesome!

    I'm seeing this glitch, not sure if it's something you know about....

    1. Overview URL = working/ http://screencast.com/t/4MUrAsbdJ

    2. Details page http://screencast.com/t/6xfzH2TFL

    URL missing a trailing slash

    -

    Laurie

  • Stefan Kip 1606 posts 4098 karma points c-trib
    Dec 13, 2013 @ 14:53
    Stefan Kip
    0

    Could you create a new topic for this issue and mention a bit more information about your set-up (like your umbraco URL settings) and post the entry from the DB?

  • Peter 89 posts 160 karma points
    Dec 16, 2013 @ 19:38
    Peter
    0

    Thanks Stefan!

    Seems to be working ok for me :)

    #h5yr!

    EDIT : to clarify, I am just redirecting 404s using the tool. All of which are old .html extensions

  • 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