Skip to content

Commit

Permalink
Merge branch 'hotfix' into hotfix-39125
Browse files Browse the repository at this point in the history
  • Loading branch information
apple843119 committed Feb 27, 2024
2 parents 153523f + 1f596d2 commit 308a09e
Show file tree
Hide file tree
Showing 39 changed files with 629 additions and 121 deletions.
24 changes: 20 additions & 4 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ steps:
- cd $DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/add_group.spec.js
- cd $DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/add_membership_type.spec.js
- cd $DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/import.spec.js
- cd $DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/event_register.spec.js
- cd $DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/event_normal_register.spec.js
- cd $DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/event_limit_nowait_register.spec.js
- cd $DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/event_limit_wait_register.spec.js
- cd $DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/event_limit_approval_register.spec.js
- cd $DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/event_unlimit_approval_register.spec.js
- cd $DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/event_participant.spec.js
- cd $DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/edit_mailing.spec.js
- cd $DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/contribution_spgateway.spec.js
Expand Down Expand Up @@ -128,7 +132,11 @@ steps:
- cd $DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/add_group.spec.js
- cd $DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/add_membership_type.spec.js
- cd $DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/import.spec.js
- cd $DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/event_register.spec.js
- cd $DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/event_normal_register.spec.js
- cd $DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/event_limit_nowait_register.spec.js
- cd $DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/event_limit_wait_register.spec.js
- cd $DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/event_limit_approval_register.spec.js
- cd $DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/event_unlimit_approval_register.spec.js
- cd $DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/event_participant.spec.js
- cd $DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/edit_mailing.spec.js
- cd $DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/contribution_spgateway.spec.js
Expand Down Expand Up @@ -209,7 +217,11 @@ steps:
- cd $DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/add_group.spec.js
- cd $DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/add_membership_type.spec.js
- cd $DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/import.spec.js
- cd $DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/event_register.spec.js
- cd $DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/event_normal_register.spec.js
- cd $DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/event_limit_nowait_register.spec.js
- cd $DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/event_limit_wait_register.spec.js
- cd $DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/event_limit_approval_register.spec.js
- cd $DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/event_unlimit_approval_register.spec.js
- cd $DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/event_participant.spec.js
- cd $DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/edit_mailing.spec.js
- cd $DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/contribution_spgateway.spec.js
Expand Down Expand Up @@ -289,7 +301,11 @@ steps:
- cd $DRUPAL_ROOT/modules/civicrm/tests/playwright/ && npx playwright test tests/add_group.spec.js
- cd $DRUPAL_ROOT/modules/civicrm/tests/playwright/ && npx playwright test tests/add_membership_type.spec.js
- cd $DRUPAL_ROOT/modules/civicrm/tests/playwright/ && npx playwright test tests/import.spec.js
- cd $DRUPAL_ROOT/modules/civicrm/tests/playwright/ && npx playwright test tests/event_register.spec.js
- cd $DRUPAL_ROOT/modules/civicrm/tests/playwright/ && npx playwright test tests/event_normal_register.spec.js
- cd $DRUPAL_ROOT/modules/civicrm/tests/playwright/ && npx playwright test tests/event_limit_nowait_register.spec.js
- cd $DRUPAL_ROOT/modules/civicrm/tests/playwright/ && npx playwright test tests/event_limit_wait_register.spec.js
- cd $DRUPAL_ROOT/modules/civicrm/tests/playwright/ && npx playwright test tests/event_limit_approval_register.spec.js
- cd $DRUPAL_ROOT/modules/civicrm/tests/playwright/ && npx playwright test tests/event_unlimit_approval_register.spec.js
- cd $DRUPAL_ROOT/modules/civicrm/tests/playwright/ && npx playwright test tests/event_participant.spec.js
- cd $DRUPAL_ROOT/modules/civicrm/tests/playwright/ && npx playwright test tests/edit_mailing.spec.js
- name: notify
Expand Down
37 changes: 31 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,16 @@ jobs:
run: docker exec neticrm-ci bash -c "cd \$DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/add_membership_type.spec.js"
- name: Frontend - Import Records - Playwright
run: docker exec neticrm-ci bash -c "cd \$DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/import.spec.js"
- name: Frontend - Event Registration - Playwright
run: docker exec neticrm-ci bash -c "cd \$DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/event_register.spec.js"
- name: Frontend - Event Normal Registration - Playwright
run: docker exec neticrm-ci bash -c "cd \$DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/event_normal_register.spec.js"
- name: Frontend - Event Registration for limited participants without waitlist - Playwright
run: docker exec neticrm-ci bash -c "cd \$DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/event_limit_nowait_register.spec.js"
- name: Frontend - Event Registration for limited participants with waitlist - Playwright
run: docker exec neticrm-ci bash -c "cd \$DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/event_limit_wait_register.spec.js"
- name: Frontend - Event Registration for limited participants required approval - Playwright
run: docker exec neticrm-ci bash -c "cd \$DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/event_limit_approval_register.spec.js"
- name: Frontend - Event Registration for unlimited participants require approval - Playwright
run: docker exec neticrm-ci bash -c "cd \$DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/event_unlimit_approval_register.spec.js"
- name: Frontend - Participant Editing - Playwright
run: docker exec neticrm-ci bash -c "cd \$DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/event_participant.spec.js"
- name: Frontend - Mailing Editing - Playwright
Expand Down Expand Up @@ -179,8 +187,16 @@ jobs:
run: docker exec neticrm-ci bash -c "cd \$DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/add_membership_type.spec.js"
- name: Frontend - Import Records - Playwright
run: docker exec neticrm-ci bash -c "cd \$DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/import.spec.js"
- name: Frontend - Event Registration - Playwright
run: docker exec neticrm-ci bash -c "cd \$DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/event_register.spec.js"
- name: Frontend - Event Normal Registration - Playwright
run: docker exec neticrm-ci bash -c "cd \$DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/event_normal_register.spec.js"
- name: Frontend - Event Registration for limited participants without waitlist - Playwright
run: docker exec neticrm-ci bash -c "cd \$DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/event_limit_nowait_register.spec.js"
- name: Frontend - Event Registration for limited participants with waitlist - Playwright
run: docker exec neticrm-ci bash -c "cd \$DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/event_limit_wait_register.spec.js"
- name: Frontend - Event Registration for limited participants required approval - Playwright
run: docker exec neticrm-ci bash -c "cd \$DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/event_limit_approval_register.spec.js"
- name: Frontend - Event Registration for unlimited participants require approval - Playwright
run: docker exec neticrm-ci bash -c "cd \$DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/event_unlimit_approval_register.spec.js"
- name: Frontend - Participant Editing - Playwright
run: docker exec neticrm-ci bash -c "cd \$DRUPAL_ROOT/sites/all/modules/civicrm/tests/playwright/ && npx playwright test tests/event_participant.spec.js"
- name: Frontend - Mailing Editing - Playwright
Expand Down Expand Up @@ -276,13 +292,22 @@ jobs:
run: docker exec neticrm-ci bash -c "cd \$DRUPAL_ROOT/modules/civicrm/tests/playwright/ && npx playwright test tests/add_membership_type.spec.js"
- name: Frontend - Import Records - Playwright
run: docker exec neticrm-ci bash -c "cd \$DRUPAL_ROOT/modules/civicrm/tests/playwright/ && npx playwright test tests/import.spec.js"
- name: Frontend - Event Registration - Playwright
run: docker exec neticrm-ci bash -c "cd \$DRUPAL_ROOT/modules/civicrm/tests/playwright/ && npx playwright test tests/event_register.spec.js"
- name: Frontend - Event Normal Registration - Playwright
run: docker exec neticrm-ci bash -c "cd \$DRUPAL_ROOT/modules/civicrm/tests/playwright/ && npx playwright test tests/event_normal_register.spec.js"
- name: Frontend - Event Registration for limited participants without waitlist - Playwright
run: docker exec neticrm-ci bash -c "cd \$DRUPAL_ROOT/modules/civicrm/tests/playwright/ && npx playwright test tests/event_limit_nowait_register.spec.js"
- name: Frontend - Event Registration for limited participants with waitlist - Playwright
run: docker exec neticrm-ci bash -c "cd \$DRUPAL_ROOT/modules/civicrm/tests/playwright/ && npx playwright test tests/event_limit_wait_register.spec.js"
- name: Frontend - Event Registration for limited participants required approval - Playwright
run: docker exec neticrm-ci bash -c "cd \$DRUPAL_ROOT/modules/civicrm/tests/playwright/ && npx playwright test tests/event_limit_approval_register.spec.js"
- name: Frontend - Event Registration for unlimited participants require approval - Playwright
run: docker exec neticrm-ci bash -c "cd \$DRUPAL_ROOT/modules/civicrm/tests/playwright/ && npx playwright test tests/event_unlimit_approval_register.spec.js"
- name: Frontend - Participant Editing - Playwright
run: docker exec neticrm-ci bash -c "cd \$DRUPAL_ROOT/modules/civicrm/tests/playwright/ && npx playwright test tests/event_participant.spec.js"
- name: Frontend - Mailing Editing - Playwright
run: docker exec neticrm-ci bash -c "cd \$DRUPAL_ROOT/modules/civicrm/tests/playwright/ && npx playwright test tests/edit_mailing.spec.js"


- uses: actions/upload-artifact@v3
if: always()
with:
Expand Down
4 changes: 2 additions & 2 deletions CRM/AI/Page/AJAX.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ public static function chat() {
'CiviContribute' => ['civicrm/admin/contribute/add', 'civicrm/admin/contribute/setting'],
'CiviEvent' => ['civicrm/event/add', 'civicrm/event/manage/eventInfo'],
'CiviMail' => ['civicrm/mailing/send'],
'Activity' => ['civicrm/activity/add', 'civicrm/contact/view/activity'],
'Activity' => ['civicrm/activity/add', 'civicrm/contact/view/activity', 'civicrm/contact/search'],
];

foreach ($allowPatterns as $component => $allowedUrls) {
foreach ($allowedUrls as $allowedUrl) {
if (strstr($url, $allowedUrl)) {
if ($component === "Activity" && strstr($jsondata['sourceUrl'], "atype=$mailTypeId")) {
if ($component === "Activity" && (strstr($jsondata['sourceUrl'], "atype=$mailTypeId") || strstr($jsondata['sourceUrl'], "_qf_Email_display"))) {
$data['component'] = $component;
break 2;
} elseif ($component !== "Activity") {
Expand Down
5 changes: 5 additions & 0 deletions CRM/Admin/Form/Setting/Miscellaneous.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ public function buildQuickForm() {
$this->addYesNo('versionCheck', ts('Version Check & Statistics Reporting'));
$this->assign('admin', TRUE);
$this->addTextfield('docURLBase', ts('Documentation URL Base Path'));

// Refs #38829, Add Path to qpdf executable field.
$this->addElement('text', 'qpdfPath', ts('Path to qpdf executable'),
array('size' => 64, 'maxlength' => 256)
);
}
else {
$this->assign('admin', FALSE);
Expand Down
9 changes: 9 additions & 0 deletions CRM/Admin/Form/Setting/Receipt.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ public function buildQuickForm() {

$check = TRUE;
parent::buildQuickForm($check);

// Refs #38829, Add receipt Email Encryption option
if (defined('CIVICRM_ENABLE_PDF_ENCRYPTION') && CIVICRM_ENABLE_PDF_ENCRYPTION) {
$this->add('checkbox', 'receiptEmailEncryption', ts('Email Receipt Password'));
$this->addElement('text', 'receiptEmailEncryptionText', ts('Email Receipt Password Explanation Text'));
}
}

function setDefaultValues() {
Expand Down Expand Up @@ -130,6 +136,9 @@ public function postProcess() {
if (!empty($haveAttachReceiptOption) && empty($params['receiptEmailAuto'])) {
$params['receiptEmailAuto'] = FALSE;
}
if (empty($params['receiptEmailEncryption'])) {
$params['receiptEmailEncryption'] = FALSE;
}

parent::commonProcess($params);
}
Expand Down
14 changes: 6 additions & 8 deletions CRM/Admin/Form/Setting/Recurring.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,12 @@ public function buildQuickForm() {
);
$this->addElement('select', 'recurringCopySetting', ts('Copy Contribution'), $option);

if (defined('ENABLE_COPY_CONTRIBUTION_PAGE_TYPE') && ENABLE_COPY_CONTRIBUTION_PAGE_TYPE) {
//add select option
$options = array(
'0' => ts("From source contribution."),
'1' => ts("From contribution page setting."),
);
$this->addElement('select', 'copyContributionTypeSource', ts("Copied Contribution Type Source"), $options);
}
//add select option
$options = array(
'0' => ts("From source contribution."),
'1' => ts("From contribution page setting."),
);
$this->addElement('select', 'copyContributionTypeSource', ts("Copied Contribution Type Source"), $options);

// redirect to Administer Section After hitting either Save or Cancel button.
$session = CRM_Core_Session::singleton();
Expand Down
2 changes: 1 addition & 1 deletion CRM/Contact/BAO/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ static function &create(&$params, $fixAddress = TRUE, $invokeHooks = TRUE, $skip
// #30818, we have serious deadlock issue, should never doing cache reset every contact create
if (empty($config->doNotResetGroupContactCache)) {
// check previous purge date from this source, trigger cache remove at least over 3 minutes
$createdTime = CRM_REQUEST_TIME - 60*CRM_Contact_BAO_GroupContactCache::SMARTGROUP_CACHE_TIMEOUT_MINIMAL;
$createdTime = CRM_REQUEST_TIME - CRM_Contact_BAO_GroupContactCache::SMARTGROUP_CACHE_TIMEOUT_MINIMAL;
$alreadyPurged = CRM_Core_BAO_Cache::getItem('GroupContactCache', 'CreateContactPurgeFlag', $createdTime);
if (empty($alreadyPurged)) {
CRM_Contact_BAO_GroupContactCache::remove();
Expand Down
5 changes: 4 additions & 1 deletion CRM/Contact/BAO/GroupContactCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@

class CRM_Contact_BAO_GroupContactCache extends CRM_Contact_DAO_GroupContactCache {

const SMARTGROUP_CACHE_TIMEOUT_MINIMAL = 3;
/**
* Minimal cache time in seconds
*/
const SMARTGROUP_CACHE_TIMEOUT_MINIMAL = 30;

static $_alreadyLoaded = array();

Expand Down
12 changes: 7 additions & 5 deletions CRM/Contact/BAO/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -2705,7 +2705,7 @@ function addGroupContactCache($groups, $tableAlias = NULL, $joinTable = "contact
// refs #31308, do not refresh smart group too often
$config = CRM_Core_Config::singleton();
$minimalCacheTime = CRM_Contact_BAO_GroupContactCache::SMARTGROUP_CACHE_TIMEOUT_MINIMAL;
if (CRM_REQUEST_TIME - $minimalCacheTime*60 > strtotime($group->cache_date)) {
if (CRM_REQUEST_TIME - $minimalCacheTime > strtotime($group->cache_date)) {
CRM_Contact_BAO_GroupContactCache::load($group);
}
}
Expand Down Expand Up @@ -4268,7 +4268,8 @@ function &summaryContribution($context = NULL) {
cc.currency as currency";

// make sure contribution is completed - CRM-4989
$where .= " AND civicrm_contribution.contribution_status_id = 1 ";
$whereForTotal = $where;
$whereForTotal .= " AND civicrm_contribution.contribution_status_id = 1 ";
if ($context == 'search') {
$where .= " AND contact_a.is_deleted = 0 ";
}
Expand All @@ -4277,7 +4278,7 @@ function &summaryContribution($context = NULL) {
$summary['total'] = array();
$summary['total']['count'] = $summary['total']['amount'] = $summary['total']['avg'] = "n/a";

$query = "$select FROM (SELECT civicrm_contribution.total_amount, civicrm_contribution.currency $from $where GROUP BY civicrm_contribution.id) cc GROUP BY cc.currency";
$query = "$select FROM (SELECT civicrm_contribution.total_amount, civicrm_contribution.currency $from $whereForTotal GROUP BY civicrm_contribution.id) cc GROUP BY cc.currency";
$params = array();

$dao = CRM_Core_DAO::executeQuery($query, $params);
Expand All @@ -4304,12 +4305,13 @@ function &summaryContribution($context = NULL) {
AVG( cc.total_amount ) as cancel_avg,
cc.currency as currency";

$where .= " AND civicrm_contribution.cancel_date IS NOT NULL ";
$whereForCancel = $where;
$whereForCancel .= " AND civicrm_contribution.contribution_status_id = 3 ";
if ($context == 'search') {
$where .= " AND contact_a.is_deleted = 0 ";
}

$query = "$select FROM (SELECT civicrm_contribution.total_amount, civicrm_contribution.currency $from $where GROUP BY civicrm_contribution.id) cc GROUP BY cc.currency";
$query = "$select FROM (SELECT civicrm_contribution.total_amount, civicrm_contribution.currency $from $whereForCancel GROUP BY civicrm_contribution.id) cc GROUP BY cc.currency";
$dao = CRM_Core_DAO::executeQuery($query, $params);

if ($dao->N <= 1) {
Expand Down
Loading

0 comments on commit 308a09e

Please sign in to comment.