I've noticed this before and just ran across it again. I'd like to get this behavior confirmed: when you add an action to a predicate and then go trigger that predicate, the action doesn't seem to get performed unless you first clicked the "Save changes" button on the attributes form. This shouldn't be necessary given the way the form is supposed to work. This may also in fact be true for conditions.

Comments

Island Usurper’s picture

That'd be a "confirmed", there, bud. The "Remove Action" button works without clicking "Save changes", though.

I think I found why. The action is present in the database row for the predicate, but it doesn't look like it's in the right format. There is an #arguments key, where there should be an #argument_map. There is also not a #settings key until "Save changes" is clicked. This sounds to me like there's a bug in the submit handler for "Add action".

nymo’s picture

Just ran into that bug...is there a proposed solution for this?

As Island Usurper noticed, the #argument_map is not inserted into the serialized actions. The problem is that, during add action form submission, ca_actions_form_update_actions() is called, which i think sets the predicate's actions properly, but then ca_add_action() is called right after.

Since they both call ca_save_predicate(), the latter overwrites the former, and doesn't include the argument_map nor settings variables.

A quick fix would be to remove the call to ca_add_action(), but i think fixing how an action is saved in the database is a better solution.

torgosPizza’s picture

Can you submit a patch? I'd be able to test it.

TR’s picture

Version: 6.x-2.0-rc3 » 6.x-2.x-dev

I have yet to confirm that this is still a bug. Just moving the issue to -dev.

TR’s picture

Priority: Normal » Minor
Status: Active » Postponed

If someone is willing to work on this, please submit a patch. CA has been deprecated in favor of Rules, so there's not much point in putting a lot of effort into usability issues this late in the game.

longwave’s picture

Status: Postponed » Closed (won't fix)

Not convinced this is actually a problem, and either way it's not really worth fixing in 6.x now.