Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
- disable rules when dependent modules are disabled, and enable them again afterwards
- mark rules as broken so the UI can properly deal with them (mark them, but don't deal with them. show missing dependency.)
- allow deleting broken rules
Should we deal with rules that have a failing integrity-check similarly?
Comment | File | Size | Author |
---|---|---|---|
#4 | rules_dependencies.patch | 23.88 KB | fago |
#2 | 1223028-rules-dependencies.patch | 9.75 KB | klausi |
#1 | 1223028-rules-dependencies.patch | 7.93 KB | klausi |
Comments
Comment #1
klausiHere is a patch:
* Adds a rules_dependencies table to track dependencies
* Adds a db column "dirty" to rules_config to track broken configurations
* Adds a "dependencies" property to Rules configurations on load
* uses hook_modules_disable/enable() to update the "dirty" flag
* Adds a RulesDependencyException
TODO:
* Mark configs as dirty during execution
* Don't execute dirty configurations
* Display dirty configurations properly in the UI
* Tests
Comment #2
klausiSome progress, but I'm not sure if this is the right way.
integrityCheck() now sets the dirty flag. Reaction rules that execute a dirty component are now marked as dirty, too.
TODO:
* how many dirty states do we need? only one?
* all other TODOs from above
Comment #3
fagoLet's use a single dirty state + have exceptions tell why it is dirty when integrityCheck() is called. With the dependencies() information now loaded into the entity object, this approach should be good to go.
Perhaps we should clean up the exception handling first though.
Comment #4
fagook, I finished the patch + added tests. Works for me.
Todo: Implement UI changes, i.e. show in the admin UI when rules are failing, including the error message.
Comment #5
fagook, I've improved the UI to work better for configurations having error + added in displaying of error messages.
Attached patch works for me -> committed.