Currently, if I understand the code correctly, only user-defined or overridden predicates are stored in the DB. That means that the admin page and ca_load_trigger_predicates() need to do a few complex operations to load the default predicates and merge them with those from the db.

I suggest we move all module-defined predicates to the DB, by implementing a ca_predicate_rehash() function, similar to how core deals with block definition. That would allow use to simplify a great deal the admin page and ca_load_trigger_predicates(), and lower the memory footprint and increase the performance of ca_pull_trigger().

Comments

rszrama’s picture

Good call. I'm not aware of how Drupal does this. Would we basically just check via hook_init() or some other point whether or not the predicates had been stored to the DB and update them if need be? I'm assuming we'd have some way to reset them, like through a cache reset or something?

mikejoconnor’s picture

subscribe

vitis’s picture

subscribing

Island Usurper’s picture

One thing that annoys me about setting up a new Ubercart site is that after I enable my modules, I still have to go to the Block admin page for my module-defined default blocks to appear. I want to make sure that we don't do a similar thing for Conditional Actions, because it's much more difficult to notice that none of them are showing up yet than blocks.

longwave’s picture

Status: Active » Closed (won't fix)

This is not going to get fixed in 2.x, and CA is gone in 3.x.