CRM-17686 disable flexible jobs extension...
authorDavid Reedy Jr <davidrjr.konadave@gmail.com>
Mon, 28 Dec 2015 23:50:39 +0000 (17:50 -0600)
committerDavid Reedy Jr <davidrjr.konadave@gmail.com>
Thu, 31 Dec 2015 23:23:27 +0000 (17:23 -0600)
...when upgrading.

CRM/Upgrade/Incremental/php/FourSeven.php

index b11c80fc57804b162d917875b6cd2c1b9e52bc08..2fd013a061e66d0efe66842174e4937434ca962b 100644 (file)
@@ -134,6 +134,15 @@ class CRM_Upgrade_Incremental_php_FourSeven extends CRM_Upgrade_Incremental_Base
     $this->addTask('Delete unused file', 'deleteVersionCheckCacheFile');
   }
 
+  /**
+   * Upgrade function.
+   *
+   * @param string $rev
+   */
+  public function upgrade_4_7_beta5($rev) {
+    $this->addTask('Disable flexible jobs extension', 'disableFlexibleJobsExtension');
+  }
+
   /**
    * CRM-16354
    *
@@ -363,4 +372,17 @@ FROM `civicrm_dashboard_contact` WHERE 1 GROUP BY contact_id";
     return TRUE;
   }
 
+  /**
+   * CRM-17669 and CRM-17686, make scheduled jobs more flexible, disable the 4.6 extension if installed
+   *
+   * @param \CRM_Queue_TaskContext $ctx
+   *
+   * @return bool
+   */
+  public function disableFlexibleJobsExtension(CRM_Queue_TaskContext $ctx) {
+    CRM_Core_DAO::setFieldValue('CRM_Core_DAO_Job', 'Flexible Jobs', 'is_active', 0, 'name');
+
+    return TRUE;
+  }
+
 }