- aComment.setValueForProperty("is_published", "1");
- aComment.setValueForProperty("to_comment_status", "1");
- aComment.setValueForProperty("is_html","0");
- aComment.setValueForProperty("to_media", (String) aSession.getAttribute("to_media"));
+ try {
+ aComment.setFieldValue("is_published", "1");
+ ModuleCommentStatus module = new ModuleCommentStatus();
+ aComment.setFieldValue("to_comment_status", module.commentStatusIdForName(configuration.getString("Localizer.OpenSession.comment.DefaultCommentStatus")));
+ aComment.setFieldValue("is_html", "0");
+ aComment.setFieldValue("to_media", (String) aSession.getAttribute("to_media"));
+ }
+ catch (Throwable t) {
+ throw new SessionFailure(t);
+ }