Skip to content

Commit

Permalink
Issue 26341 Rules do not fire on "Show Preview" (#30832)
Browse files Browse the repository at this point in the history
Removed a check that was avoiding to fire the rule when the user was
admin
  • Loading branch information
gortiz-dotcms authored Dec 4, 2024
1 parent 4b18b48 commit a20b5e4
Showing 1 changed file with 1 addition and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,19 +172,7 @@ public static void fireRules(final HttpServletRequest request, final HttpServlet
if (!UtilMethods.isSet(request)) {
throw new DotRuntimeException("ERROR: HttpServletRequest is null");
}

// do not run rules in admin mode
PageMode mode= PageMode.get(request);
if(mode.isAdmin) {
final boolean fireRulesFromParameter =Try.of(()->Boolean.valueOf
(request.getParameter("fireRules"))).getOrElse(false);
final boolean fireRulesFromAttribute =Try.of(()-> Boolean.valueOf((Boolean)
request.getAttribute("fireRules"))).getOrElse(false);

if(!fireRulesFromParameter && !fireRulesFromAttribute) {
return;
}
}


final Set<String> alreadyFiredRulesFor =request.getAttribute(DOT_RULES_FIRED_ALREADY)!=null?(Set<String>)request.getAttribute(DOT_RULES_FIRED_ALREADY):new HashSet<String>();
final String ruleRunKey = parent.getIdentifier() +"_"+ fireOn.name();
Expand Down

0 comments on commit a20b5e4

Please sign in to comment.