Uninstalling the Rules module removes all settings visible in the Rules config but the cache_rules tables does not get flushed and will not be removed. Flushing caches via Drush and Devel do not fix it. The database table remains and the set up rule fires. Reenabling Rules leaves the settings visually resetted (no config items) but the rules in cache still fire. Starting to set up a new rule with the same name then the old one, opens the new rule already with the set up parts from the old one. This inconsistency makes it impossible to clean up Rules 100% and makes it hard to test and contribute to it.
Comments
Comment #2
jhalred CreditAttribution: jhalred as a volunteer commentedThis issue is also in version 8.x-3.0-alpha3. Is there any work-around or manual fix I can use to clean up cache_rules? No matter what I've tries, the "ghost rules" still fire.
Comment #3
jhalred CreditAttribution: jhalred as a volunteer commentedI have found a way to delete the "ghost rules" so I can at least remove rules I don't want and make modifications. This works for me in version 8.x-3.0-alpha3:
1. delete the rule(s) using the drupal interface
2. go to the cache_rule(s) table in phpmyadmin
3. select and delete the rule(s)
4. create a new rule using the drupal interface
The steps above got me out of the "ghost rules" jam.
Comment #4
docans CreditAttribution: docans commentedWhat solution do you have for those without phpmyadmin. I am using Docksal as my dev environment. Its really sad how Rules is acting in drupal 8
Comment #5
StevenPatzGoing to tackle this, this weekend.
Comment #6
TR CreditAttribution: TR commentedCould this be due to #2852231: Cache bin doesn't follow the naming convention? Core would normally clear the module's cache when uninstalling, but since Rules doesn't name its cache properly ...
Can you test out the patch in that issue to see if it resolves this one too?
Comment #7
TR CreditAttribution: TR commented@StevenPatz: Did you get a chance to work on this? #2852231: Cache bin doesn't follow the naming convention has been committed, so maybe it fixed this as well?
Comment #8
StevenPatz@TR Busy holiday season. I can look at this, this weekend.
Comment #9
StevenPatzLooks like this is resolved now. I installed the Rules module, created a rule and then uninstalled the Rules module. Cleared the Drupal cache and reinstalled the Rules module and there were no rules listed.
Comment #10
TR CreditAttribution: TR commented@StevenPatz: Thanks for looking into it!
I have tried to reproduce the original report with the current 8.x-3.x-dev, and I can confirm that the cache_rules table does get removed now when Rules is uninstalled, and there doesn't seem to be any Rules data left in the database. I'm going to assume #2852231: Cache bin doesn't follow the naming convention fixed the issue.
I'm marking this as fixed, but if the problem re-occurs in 8.x-3.x-dev feel free to reopen the issue and provide instructions to reproduce the error.