Commit 0dc85045 authored by Jamie McClelland's avatar Jamie McClelland

don't try to set default message on non-target petitions.

parent 0c608ae4
......@@ -96,6 +96,10 @@ function petitionemail_civicrm_buildForm( $formName, &$form ) {
$dao = CRM_Core_DAO::executeQuery( $sql, $params );
$defaults = array();
$dao->fetch();
if($dao->N == 0) {
// Not a email enabled petition
return;
}
$message_field = $dao->message_field;
$defaults[$message_field] = $dao->default_message;
$form->setDefaults($defaults);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment