Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
extensions
cc.tadpole.petitionemail
Commits
4a4912fa
Commit
4a4912fa
authored
Dec 05, 2014
by
Jamie McClelland
Browse files
ensure we only check primary addresses.
parent
2f8c5645
Changes
1
Hide whitespace changes
Inline
Side-by-side
petitionemail.php
View file @
4a4912fa
...
...
@@ -1007,11 +1007,15 @@ function petitionemail_get_recipients($contact_id, $petition_id) {
}
else
{
// Handle non-custom fields (address fields)
// We only support primary address.
$field_pieces
=
petitionemail_split_address_field
(
$matching_field
);
$field_name
=
$field_pieces
[
'field_name'
];
if
(
!
in_array
(
'civicrm_address'
,
$added_tables
))
{
$from
[]
=
"LEFT JOIN civicrm_address a ON a.contact_id = c.id"
;
$added_tables
[]
=
'civicrm_address'
;
}
$field_where
[]
=
'('
.
$matching_field
.
' = %'
.
$id
.
')'
;
$where_fragment
[]
=
$field_name
.
' = %'
.
$id
;
$where_fragment
[]
=
'a.is_primary = 1'
;
$params
[
$id
]
=
array
(
$value
,
'String'
);
$id
++
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment