From 4a564b19980870e8a85a330d7705b8264e5a233c Mon Sep 17 00:00:00 2001 From: k054 Date: Fri, 10 Jun 2016 15:47:35 -0500 Subject: [PATCH] 4.6.18 --- CRM/Contribute/BAO/Contribution.php | 6 ++---- CRM/Upgrade/Incremental/sql/4.6.18.mysql.tpl | 4 ++++ templates/CRM/Contribute/Form/Contribution/OnBehalfOf.tpl | 7 ++++++- 3 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 CRM/Upgrade/Incremental/sql/4.6.18.mysql.tpl diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 4d0f5b6b3b..0a5cb9e98f 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -4839,10 +4839,8 @@ LIMIT 1;"; do { $creditNoteNum++; $creditNoteId = CRM_Utils_Array::value('credit_notes_prefix', $prefixValue) . "" . $creditNoteNum; - $result = civicrm_api3('Contribution', 'getcount', array( - 'sequential' => 1, - 'creditnote_id' => $creditNoteId, - )); + $params = array(1 => array($creditNoteId, 'String')); + $result = CRM_Core_DAO::singleValueQuery("SELECT count(id) FROM civicrm_contribution WHERE creditnote_id = %1", $params); } while ($result > 0); return $creditNoteId; diff --git a/CRM/Upgrade/Incremental/sql/4.6.18.mysql.tpl b/CRM/Upgrade/Incremental/sql/4.6.18.mysql.tpl new file mode 100644 index 0000000000..09edb02619 --- /dev/null +++ b/CRM/Upgrade/Incremental/sql/4.6.18.mysql.tpl @@ -0,0 +1,4 @@ +{* file to handle db changes in 4.6.18 during upgrade *} +-- CRM-18516 Convert the date fields relating to group caching and acl caching timestamp +ALTER TABLE civicrm_group CHANGE cache_date cache_date timestamp NULL DEFAULT NULL , CHANGE refresh_date refresh_date timestamp NULL DEFAULT NULL; +ALTER TABLE civicrm_acl_cache CHANGE modified_date modified_date timestamp NULL DEFAULT NULL; diff --git a/templates/CRM/Contribute/Form/Contribution/OnBehalfOf.tpl b/templates/CRM/Contribute/Form/Contribution/OnBehalfOf.tpl index 3b902015a3..02e0c36e9d 100644 --- a/templates/CRM/Contribute/Form/Contribution/OnBehalfOf.tpl +++ b/templates/CRM/Contribute/Form/Contribution/OnBehalfOf.tpl @@ -191,7 +191,12 @@ else { // do not set defaults to file type fields if ($('#' + ele).attr('type') != 'file') { - $('#' + ele ).val(data[ele].value).change(); + if (ele.split("_").pop() == 'display') { + $("[id^='"+ele+"']").val(data[ele].value).change(); + } + else { + $('#' + ele ).val(data[ele].value).change(); + } } } } -- 2.25.1