Copied to clipboard

Flag this post as spam?

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


  • Wayne Godfrey 11 posts 42 karma points
    Oct 16, 2013 @ 16:33
    Wayne Godfrey
    0

    Publish At not working for DateFolders enabled documents

    Umbraco 6.1.6 installation with version 2.0.1 of DateFolders installed.

    Using the Publish At feature of Umbraco to publish a DateFolders enabled document to publish at a future date/time results in the document being published but not being written to the cache and therefore unavailable.

    I installed the source code and ran through the debugger and found that the following line in the Document_AfterSave method was generating an exception for a null value because the current HttpContext was null:

    var page = HttpContext.Current.CurrentHandler as Page;
    

    Replacing that line with the following code (DISCLAIMER: NOT EXHAUSTIVELY TESTED) allowed the Publish At feature to work properly:

    HttpContext context = HttpContext.Current;
    Page page = null;
    if(context != null)
       page = HttpContext.Current.CurrentHandler as Page;
    
  • Matthew Wise 271 posts 1373 karma points MVP 4x c-trib
    Oct 21, 2013 @ 09:47
    Matthew Wise
    100

    Cheers, Wayne I have updated the code now just to test it some more then release it into the world once more!

  • Wayne Godfrey 11 posts 42 karma points
    Oct 21, 2013 @ 15:27
    Wayne Godfrey
    0

    I've had the change running for a week now and it appears to be working well. I haven't experienced any problems.

  • Matthew Wise 271 posts 1373 karma points MVP 4x c-trib
    Oct 23, 2013 @ 09:59
    Matthew Wise
    0

    Out in the wild with some more changes/ improvements

Please Sign in or register to post replies

Write your reply to:

Draft