While enhancing our blogs portlet functionality, I came across what appeared to be a few interesting oversights while editing blogs. While editing and publishing (or submitting for publication) a blog entry worked entirely as expected, if one selected the “Save as Draft” option, several items were not saved, namely the Categories selected, whether Pingbacks and/or Trackbacks were selected, and the “Trackbacks to Send” field. Since we do a lot of blog creation in our spare time, we rarely complete an entry in one sitting, so the draft feature is important to us.

The problem code lies in the html/portlet/blogs/entry_edit.jsp. In this file, there is a javascript function, saveEntry(draft), which takes a true/false argument. In the case of a draft, the function builds a custom A.io.request object with a data section that does not include the categories or 2 checkbox controls.
The fix is relatively simple, by creating a jsp hook project, copy the html/portlet/blogs/entry_edit.jsp into the custom jsp docroot, and add the following 3 lines to the data segment:
<portlet:namespace />allowPingbacks: document.<portlet:namespace />fm.<portlet:namespace />allowPingbacks.value,
<portlet:namespace />allowTrackbacks: document.<portlet:namespace />fm.<portlet:namespace />allowTrackbacks.value,
<portlet:namespace />assetCategoryIds: document.<portlet:namespace />fm.<portlet:namespace />assetCategoryIds.value,

Deploy the hook and your drafts should now include the settings for these 3 fields.

The last field, the “Trackbacks to Send”, is processed on publication/submit for publication when the blog entry receives a linkable reference ID. There is no saved state for this entry, thus it cannot be stored during the draft save by the simple inclusion process used for the other three fields.
So add a simple JSP hook, deploy it and make your bloggers happier.
Share This