Merge remote-tracking branch 'origin/4.7.27-rc' into 4.7.27-rc-master-2017-10-30...
authorTim Otten <totten@civicrm.org>
Tue, 31 Oct 2017 00:02:19 +0000 (17:02 -0700)
committerTim Otten <totten@civicrm.org>
Tue, 31 Oct 2017 00:02:19 +0000 (17:02 -0700)
1  2 
CRM/Upgrade/Incremental/php/FourSeven.php

index 895d6d11533902290c925f66b08b394f838d0b59,d51e716e5d7fd0b057b348f0cae054900f173981..dba2fe049bb84d94e381f02fceaa3f81db0d8b64
@@@ -1320,21 -1311,16 +1321,33 @@@ FROM `civicrm_dashboard_contact` JOIN `
      return $config->imageUploadDir && $config->imageUploadURL && $check->isDirAccessible($config->imageUploadDir, $config->imageUploadURL);
    }
  
 +  /**
 +   * CRM-20572 - Format date fields in Contrib Sybunt custom search's saved criteria.
 +   *
 +   * @param \CRM_Queue_TaskContext $ctx
 +   *
 +   * @return bool
 +   */
 +  public static function fixDateFieldsInSmartGroups(CRM_Queue_TaskContext $ctx) {
 +    $dao = CRM_Core_DAO::executeQuery("SELECT id, form_values FROM civicrm_saved_search WHERE form_values LIKE '%CRM_Contact_Form_Search_Custom_ContribSYBNT%'");
 +    while ($dao->fetch()) {
 +      $formValues = unserialize($dao->form_values);
 +      CRM_Contact_Form_Search_Custom_ContribSYBNT::formatSavedSearchFields($formValues);
 +      CRM_Core_DAO::executeQuery("UPDATE civicrm_saved_search SET form_values = %1 WHERE id = {$dao->id}", array(1 => array(serialize($formValues), 'String')));
 +    }
++    return TRUE;
++  }
 +
+   /**
+    * CRM-20892 Convert default of created_date in civicrm_mailing table to NULL
+    * @return bool
+    */
+   public static function civiMailingCreatedDateNull(CRM_Queue_TaskContext $ctx) {
+     $dataType = 'timestamp';
+     if (CRM_Utils_Check_Component_Timestamps::isFieldType('civicrm_mailing', 'created_date', 'datetime')) {
+       $dataType = 'datetime';
+     }
+     CRM_Core_DAO::executeQuery("ALTER TABLE civicrm_mailing CHANGE created_date created_date {$dataType} NULL DEFAULT NULL COMMENT 'Date and time this mailing was created.'");
      return TRUE;
    }