CRM-17118 use shared function to add campaign field
authoreileenmcnaughton <eileen@fuzion.co.nz>
Wed, 16 Dec 2015 18:07:32 +0000 (18:07 +0000)
committereileen <emcnaughton@wikimedia.org>
Wed, 23 Dec 2015 20:47:54 +0000 (09:47 +1300)
This function does some checks to make sure there are enabled campaigns

CRM/Contribute/Form/UpdateSubscription.php

index 1ade6eca2204004203e6feb8b3e74c7158054758..3c871634a3d8e9cae91cff80d6e42ce6a79256cd 100644 (file)
@@ -159,7 +159,7 @@ class CRM_Contribute_Form_UpdateSubscription extends CRM_Core_Form {
     }
 
     if (CRM_Core_Permission::check('edit contributions')) {
-      $this->addEntityRef('campaign_id', 'Campaign', array('entity' => 'Campaign'));
+      CRM_Campaign_BAO_Campaign::addCampaign($this, CRM_Utils_Array::value('campaign_id', $this->_values));
     }
 
     $type = 'next';