No <lastModified> broke BE

Topics: Business Logic Layer
Dec 11, 2007 at 7:09 PM
Edited Dec 11, 2007 at 7:10 PM
Just found that my blog was down and after some searching found that it was due to the fact that there was no <lastModified> tag in one post. Now I dont know WHY it was missing... it is one of my older posts made in BE.Net 1.0 but I've been blogging quite a bit after upgrading to 1.2 without problems... however, the fact remains, the tag was missing and it broke BE.

In XmlBlogProvoder.cs, method SelectPost(Guid id) changing

post.DateModified = DateTime.Parse(doc.SelectSingleNode("post/lastModified").InnerText, CultureInfo.InvariantCulture);

to

if (doc.SelectSingleNode("post/lastModified")!= null)
post.DateModified = DateTime.Parse(doc.SelectSingleNode("post/lastModified").InnerText, CultureInfo.InvariantCulture);

should take care of the problem. And once you edit that post a <lastModified>-tag will hopefully be added :) Minor fix that will make BE just a little bit more stable...


I found a somewhat related topic as well... This solution might fix that as well, even though it already says "fixed".
http://www.codeplex.com/blogengine/WorkItem/View.aspx?WorkItemId=2889
Coordinator
Dec 11, 2007 at 8:55 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.