Status property always returns VersionStatus.Published

by: Ted Nyberg (Hallvarsson & Halvarsson)

I ran into some interesting anomalies involving "Access denied" when trying to fetch published pages using the GetChildren() method. I tried to determine whether or not a page was published by checking the Status property and making sure it was Published.

However, it seems this Status property returns Published even for non-published pages. According to EPiServer support they experienced the same result.

One workaround is to check the PendingPublish property and making sure it is false. This together with verifying that StartPublish is less than DateTime.Now and StopPublish is greater than DateTime.Now ought to mean that the page version you're "looking at" is published and valid.

Almost makes you wish that the GetChildren() overload including AccessLevel hadn't been cut from the API...

10 January 2008


Comments

  1. Just to clarify: the Status property is of the enum type VersionStatus, so the actual value of the property is VersionStatus.Published...
  2. man, that is sux. You would think that would pretty standard stuff..
Post a comment    
User verification Image for user verification  
Ted Nyberg (Hallvarsson & Halvarsson)

About me

I work for the corporate communications consultancy Hallvarsson & Halvarsson as a technical project manager and software architect.

Live Messenger

Hallvarsson & Halvarsson logo
 MCPD, MCTS and MCP logos

Bloggtoppen.se


Syndications


Archive


Tag cloud

EPiTrace logger