diff --git a/announcement/announcement-tool/tool/src/java/org/sakaiproject/announcement/tool/AnnouncementAction.java b/announcement/announcement-tool/tool/src/java/org/sakaiproject/announcement/tool/AnnouncementAction.java index e55794b3d08f..a72598de4035 100644 --- a/announcement/announcement-tool/tool/src/java/org/sakaiproject/announcement/tool/AnnouncementAction.java +++ b/announcement/announcement-tool/tool/src/java/org/sakaiproject/announcement/tool/AnnouncementAction.java @@ -1345,7 +1345,14 @@ public void buildSortedContext(VelocityPortlet portlet, Context context, RunData context.put("announcementItemRangeArray", viewValues); } - // context.put("jsfutil", JsfUtil.this); + + if (sstate.getAttribute("updating_sort") == Boolean.TRUE) { + state.setCurrentSortedBy(SORT_MESSAGE_ORDER); + state.setCurrentSortAsc(false); + sstate.setAttribute(STATE_CURRENT_SORTED_BY, SORT_MESSAGE_ORDER); + sstate.setAttribute(STATE_CURRENT_SORT_ASC, Boolean.FALSE); + sstate.setAttribute("updating_sort", Boolean.FALSE); + } } // buildSortedContext @@ -4324,6 +4331,9 @@ public void doReorderUpdate(RunData rundata, Context context) String peid = ((JetspeedRunData) rundata).getJs_peid(); SessionState sstate = ((JetspeedRunData) rundata).getPortletSessionState(peid); + // set updating_sort state so state.getCurrentSortedBy() and state.getCurrentSortAsc() can be reset after buildSortedContext() finishes + sstate.setAttribute("updating_sort", Boolean.TRUE); + // Storing the re-ordered sequence of the announcements if (state.getIsListVM()) {