Using K9
I have a custom module that uses macro rules, and a custom scheduled task to evaluate the rules.
I have one rule, that is the same format as the others, that when I run my scheduled task, it passes in 5 parameters to the macro, instead of 4.
This is the macro rule condition:
(_has)BadgeRule.HasLikedArticle(User,{count},"{start}", "{end}")
User is handled in the scheduled task:
MacroResolver resolver = MacroResolver.GetInstance();
resolver.SetNamedSourceData("User", user);
var result = ValidationHelper.GetBoolean(resolver.ResolveMacros(badge.BadgeRequirements), false);
When I debug the custom macro, it says 5 parameters are passed in, the first is null, and the other 4 are the ones I am passing in from the condition.
If I go to System > Macros > Benchmark and run this:
{% BadgeRule.HasLikedArticle(GlobalObjects.Users.Where("UserID = 7563").FirstItem,1,DateTime.CurrentDateTime.AddDays(-1), DateTime.Now.AddDays(8)) #%}
it passes in 4 parameters as expected.
I use this similar format (user, other params) for multiple rules/custom macros, and have no issue, but for this one it seems to break and I can't figure out why.