Copied to clipboard

Flag this post as spam?

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


  • Chris Barber 11 posts 109 karma points
    Jun 28, 2023 @ 08:16
    Chris Barber
    0

    IContent does not contain a definition for ContentSchedule

    Idiot check required please.

    I want to get the date a content page is scheduled to be published.

    The .ContentSchedule property looks like the thing I need to use on IContent but I do not seem to have access to it.enter image description here

    I am using Umbraco 10.5.1.

    Please can someone advise?

  • Marc Goodson 2155 posts 14408 karma points MVP 9x c-trib
    Jun 28, 2023 @ 13:37
    Marc Goodson
    100

    Hi Chris

    It looks like the ContentSchedule property got removed from IContent, for performance reasons, but docs not updated!

    https://github.com/umbraco/Umbraco-CMS/commit/14e1f7f7fcbb13ad83dd6215d1eab8d9a2efcdd8

    (or at least if I'm reading it right!)

    But your contentService should have a GetContentScheduleByContentId method, that I think you could use instead.

    eg

    IContent? contentPage = contentService.GetById(id);
    ContentScheduleCollection schedule = contentService.GetContentScheduleByContentId(id);
    

    regards

    Marc

  • Chris Barber 11 posts 109 karma points
    Jun 28, 2023 @ 14:36
    Chris Barber
    0

    Thanks Marc. That works for me. I am glad I am not going mad.

Please Sign in or register to post replies

Write your reply to:

Draft