Get scheduled publish date of unapproved page version

I’m trying to retrieve the scheduled publish date of a page version that has not yet been approved through the workflow. The version object has a method for getPublishDate(), but that returns NULL until that page version is actually approved. Is there another method or property I need to be using? Or is that scheduled date hidden in the workflow somewhere?

You can use the getPublishDate() / getPublishEndDate() methods of a page version to get its scheduled publish start/end date.

If you are sure they are set, please be sure to inspect the correct page version.

PS: you can also check the database: see the CollectionVersions table, fields cvPublishDate and cvPublishEndDate

Thank you for responding, but what I’m saying is that those methods return NULL until the page version is actually approved via workflow. Even the database fields are empty. I’m suspecting that the workflow itself is storing the scheduled publish date, and when that page version is approved it populates those fields. I just need to figure out how to retrieve those values from the workflow.

Oddly enough… Allow publish dates to be accessible for page workflow requests by themiddlehalf · Pull Request #9734 · concrete5/concre

Yep, that’s me. I ended up needing to modify the core to get the values from the workflow so once the change gets pulled you will be able to get them using the following on the workflow request object:

$wr->getPublishDate()
1 Like

I kinda wondered if it was you. The odds it wasn’t were really low :smiley: