Closed bleistivt closed 9 years ago
This is an excellent suggestion and something I was actually thinking about last night.
Something like RulesController_BeforeGetRules_Handler
and RulesController_AfterGetRules_Handler
make sense?
I just need to come up with a good way to allow a plugin to override a core rule.
Wouldn't a single event where you could modify the list of whats going to be included be sufficient?
I found a small problem: If you ship rules with a plugin, and have badges these rules are assigned to, disabling the plugin will crash your forum, especially if your rule is using the Gdn_Dispatcher_AppStartup Hook.
Maybe badges could default to the ManualAward rule if the rule is not found.
Yaga should definitely fail gracefully in this case.
Commit 0d39d12dc85f2a7761f84d7fcd812852f87e3184 should fix this, mind testing it for me @bleistivt?
Yes, the forum is stays usable now :)
On the settings page there's still an undefined index in /views/badge/settings.php on line 36
and Fatal error: Class not found in /views/badge/edit.php on line 13 when trying to edit the badge
Also, shouldn't the ManualAward object be reused if it's already created?
I believe I have sorted all the issues out via commit 401527c27484aaa83595e7ad1d95f75c618d1981.
Mind testing it one more time?
Couldn't find any further bugs. I'm in the process of migrating my custom award/badge/like system to Yaga, so any more bugs with plugin provided rules should show up soon.
Awesome. I am marking this as closed, as I haven't found any other issues working with it all day.
What would you think about adding an event for custom rules in RulesController->GetRules() ?
A plugin could then include rule classes or maybe even add custom paths to look for rule classes with an event argument.