"Send when any of the following flags are over the threshold" not working

archetwist - June 25, 2008 - 23:34
Project:Flag
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

Regardless of the options chosen, actions for every flag are executed.

For example, I have 3 flags and 3 send email actions. Each of the actions is assigned to one individual flag only. I flag content using *one* of the flags but get 3 e-mails (every e-mail associated with a different action).

#1

archetwist - June 27, 2008 - 18:10
Status:active» needs review

I think I have a fix.

AttachmentSize
flag.actions.inc-flag-selection.patch 812 bytes

#2

mooffie - July 3, 2008 - 22:21
Status:needs review» fixed

Archetwist, thanks. Your patch works, but I didn't use it eventually.

Problem was because in PHP the following code returns TRUE.

$array = ('alpha', 'bravo', 0, 'charlie');
return in_array('miki', $array);

Fortunately, in_array() gets an optional third parameter, strict, that fixes this. I also sanitized form checkboxes with array_filter.

http://drupal.org/cvs?commit=125234
http://drupal.org/cvs?commit=125236

#3

Anonymous (not verified) - July 23, 2008 - 10:56
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.