ALF-10837 Blog "isDraft" json can be inconsistent on boolean vs string, handle both

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@31263 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Nick Burch
2011-10-17 09:38:07 +00:00
parent 77a79cf2de
commit 435c4ac798

View File

@@ -102,7 +102,15 @@ public class BlogPostsPost extends AbstractBlogWebScript
} }
if (json.containsKey(DRAFT)) if (json.containsKey(DRAFT))
{ {
result.setIsDraft((Boolean)json.get(DRAFT)); Object draft = json.get(DRAFT);
if (draft instanceof Boolean)
{
result.setIsDraft((Boolean)draft);
}
else
{
result.setIsDraft( Boolean.parseBoolean((String)draft) );
}
} }
// If there are no tags, this is a java.lang.String "". // If there are no tags, this is a java.lang.String "".