I have a flag set to unpublish user comments so that they can get removed from display for spam. I originally had a single action for this but then sought out to have two actions. Once I added the second action only the one added later gets executed. Am I doing something wrong? Both actions have the same condition to trigger off of the same flag. Note: one sets the comment to unpublished and the other runs php code.

Comments

joachim’s picture

I never use Actions myself, so I can't be of much help. Have you tried debugging in the code that calls them, to see what's going wrong?

joachim’s picture

BTW, using Flag like this to trigger something, where (I presume) the actual storage of the flagging is totally superfluous to your needs, really isn't very efficient. You're storing extra tables and using a fairly complex module just to trigger something on a click.

coolestdude1’s picture

joachim, I was trying to solve #2307845 using flag_actions with two actions per flag. I initially had just the comment unpublish/publish on the spam flag. But the comment count numbers were wrong as mentioned in the other ticket. I then added the php action after the unpublish action in order to make sure that comment count was correct but then I notice that the unpublish was not even happening even though all I was doing was calling the statistics update and not even modifying the context or entity when running that code. So my situation consisted of adding the initial action of the flag in flag_actions and then adding the php and having only one work. Aka I added a debug in the php section and that surely came through but the comment was not unpublished even though the comment was flagged.

coolestdude1’s picture

Priority: Normal » Minor

Although I ended up solving my problem with flag hooks this continues to be a problem. Only a single action from flag_action triggers even if there are more than one.