From: Tim Otten Date: Tue, 31 Oct 2017 00:02:19 +0000 (-0700) Subject: Merge remote-tracking branch 'origin/4.7.27-rc' into 4.7.27-rc-master-2017-10-30... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=c883e6db58ce66ff538106ec558b72aa8ae9d5fb;p=civicrm-core.git Merge remote-tracking branch 'origin/4.7.27-rc' into 4.7.27-rc-master-2017-10-30-16-57-59 --- c883e6db58ce66ff538106ec558b72aa8ae9d5fb diff --cc CRM/Upgrade/Incremental/php/FourSeven.php index 895d6d1153,d51e716e5d..dba2fe049b --- a/CRM/Upgrade/Incremental/php/FourSeven.php +++ b/CRM/Upgrade/Incremental/php/FourSeven.php @@@ -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; }