Copied to clipboard

Flag this post as spam?

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


  • Tom 713 posts 954 karma points
    Mar 19, 2013 @ 05:08
    Tom
    1

    BUG - Umbraco 6.0.0 Scheduled Publish

     

    http://issues.umbraco.org/issue/U4-1947


    Description


    If you schedule publish a node and then after it has been published, unpublish it, it will automatically keep re-publishing itself because there will always be a release date for a node of that ID and the query in ContentService.cs is incorrect. It does not take in to account version ID or newest boolean flag.



    Steps to Repro


    1. Create a node (or use an existing)
    2. Set scheduled publish date/time
    3. Wait for it to publish
    4. Unpublish that node - manually by pressing unpublish button
    5. Observe after a minute or so republish on the next run



    Umbraco.Core.Services Content Service - Line 336

    Code
    public IEnumerable<IContent> GetContentForRelease()
    {
       using
    (var repository = _repositoryFactory.CreateContentRepository(_uowProvider.GetUnitOfWork()))
       
    {
       
    var query = Query<IContent>.Builder.Where(x => x.Published == false && x.ReleaseDate <= DateTime.Now);
       
    var contents = repository.GetByQuery(query);

       
    return contents;
       
    }
    }






    Prospective Fix


    Ensure queries for Release take in to account the versionID or newest bool flag on the node.

     

Please Sign in or register to post replies

Write your reply to:

Draft