c# 4.0 - Orchard CMS: Invoking two actions leads to duplicate notifications -
our orchard application displays 2 of notifications added notification service. far have traced problem , know causing it, looking solution other obvious, reasons shall elaborate.
so using number of themes render our orchard based application. within our layout, have razor call draw header bar displays set of information user logged in.
@html.action("outofgameheader", "options", new { area = "area.area.location.common" })
this action calls onresultexecuting() method in orchard.ui.notify.notifyfilter (among other things) populates messages zone current set of notifications. when make call render messages zone, same method runs again , notifications added zone's shape again resulting in duplicate notification being displayed when zone drawn.
can think of solution meets following criteria:
- drawing header without calling @html.action() avoid onresultexecuting() being triggered first time.
- without creating new widget in new zone involve changing manifest dozens of existing themes include it.
we found below point in code notifications added zone, if knows more it, helpful too.
//todo: (heskew) need keep duplicate messages being pushed zone previous behavior //baseviewmodel.messages = baseviewmodel.messages == null ? messageentries .messages.union(messageentries).tolist(); //baseviewmodel.zones.addrenderpartial("content:before", "messages", baseviewmodel.messages);
any thoughts appreciated.
avoid html.action. runs through whole lifecycle if new request. think need sign need refactor , extract logic want re-use out of controller. in orchard, it's better use dynamic shapes.
Comments
Post a Comment