Skip to content

Commit

Permalink
Merge branch 'hotfix' into hotfix-39372
Browse files Browse the repository at this point in the history
  • Loading branch information
Chang Shu-Huai committed Mar 27, 2024
2 parents 8df7ff1 + 223cc20 commit 34f5b4b
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 15 deletions.
3 changes: 1 addition & 2 deletions CRM/Core/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,7 @@ static function getInfo() {
$block[$id] = array(
'info' => $value['info'],
'cache' => $value['cache'],
'status' => $value['active'],
'region' => $value['region'],
'region' => !empty($value['region']) ? $value['region'] : NULL,
'visibility' => $value['visibility'],
'pages' => $value['pages'],
'status' => $value['status'],
Expand Down
23 changes: 16 additions & 7 deletions CRM/Core/Payment/LinePay.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,13 @@ function doRequest(&$params){
static function confirm($url_params, $get = array()){
if(empty($get)){
foreach ($_GET as $key => $value) {
if($key == 'q')continue;
if ($key == 'q') continue;
if ($key == 'qfKey') {
$value = CRM_Utils_Type::escape($value, 'String', FALSE);
}
else {
$value = CRM_Utils_Type::escape($value, 'Integer', FALSE);
}
$params[$key] = $value;
}
}
Expand All @@ -147,6 +153,7 @@ function doConfirm($params){
$result = $this->_linePayAPI->request($requestParams);

// Timeout condition.
$triedTimes = 0;
while (!empty($this->_linePayAPI->_curlError[28]) && $triedTimes < 2) {
sleep(10);
$paymentProcessorId = $this->_paymentProcessId;
Expand All @@ -155,8 +162,8 @@ function doConfirm($params){
'transactionId' => $params['transactionId'],
'orderId' => $params['cid'],
);
$result = $this->_linePayAPI->request($params);
$triedTimes += 1;
$this->_linePayAPI->request($params);
$triedTimes++;
}
$is_success = $this->_linePayAPI->_success;
$thankYouPath = 'civicrm/contribute/transact';
Expand All @@ -183,12 +190,13 @@ function doConfirm($params){
$transaction = new CRM_Core_Transaction();
if($is_success){
$input['payment_instrument_id'] = $contribution->payment_instrument_id;
$input['amount'] = $contribution->amount;
$input['amount'] = $contribution->total_amount;
$objects['contribution']->receive_date = date('YmdHis');
$transaction_result = $ipn->completeTransaction($input, $ids, $objects, $transaction);
$thankyou_url = self::prepareThankYouUrl($thankYouPath, $params['qfKey']);
}
else{
$error = '';
$ipn->failed($objects, $transaction, $error);
$this->addResponseMessageToNote($contribution);
$thankyou_url = self::prepareThankYouUrl($thankYouPath, $params['qfKey'], True);
Expand Down Expand Up @@ -236,7 +244,7 @@ static function query($url_params, $get = array()){
}

// record original cancel_date, status_id data.
$origin_cancel_date = $contribution->cancel_date;
$origin_cancel_date = (string) $contribution->cancel_date;
$origin_cancel_date = date('YmdHis', strtotime($origin_cancel_date));
$origin_status_id = $contribution->contribution_status_id;

Expand Down Expand Up @@ -275,7 +283,7 @@ static function query($url_params, $get = array()){

$query = http_build_query($get);
$redirect = CRM_Utils_System::url('civicrm/contact/view/contribution', $query);
return CRM_Core_Error::statusBounce($result_note, $redirect);
return CRM_Core_Error::statusBounce($result_note, $redirect);
}else{
CRM_Core_Error::fatal(ts('Wrong contribution ID in url query'));
}
Expand All @@ -286,8 +294,9 @@ private function addResponseMessageToNote($contribution){
$contribution = self::prepareContribution($contribution);
}
$errorMessage = CRM_Core_Payment_LinePayAPI::errorMessage($this->_linePayAPI->_response->returnCode);
$note = '';
$note .= "Error, return code is ".$this->_linePayAPI->_response->returnCode.": ".$errorMessage;
CRM_Core_Payment_Mobile::addNote($note, $contribution);
CRM_Core_Payment_Mobile::addNote($note, $contribution);
}

private static function prepareContribution($contributionId){
Expand Down
1 change: 1 addition & 0 deletions css/civicrm.css
Original file line number Diff line number Diff line change
Expand Up @@ -5094,6 +5094,7 @@ ul.ui-sortable {
#activity-content td {
padding: 4px;
vertical-align: top;
height: auto;
}

.crm-container tr.even-row td,
Expand Down
41 changes: 40 additions & 1 deletion packages/mailingEditor/mailingEditor.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,40 @@ img {
position: relative;
}

a.btn:hover {
.btn,
.button,
.form-submit,
a.btn,
a.button,
input.form-submit {
display: inline-block;
margin: .5em 1em .5em 0;
padding: 6px 10px;
text-decoration: none;
font-size: .9375rem;
line-height: 1.2;
color: #fff;
cursor: pointer;
border: none;
border-radius: 0;
background-color: #333;
transition: border .2s linear, color .2s linear, background-color .2s linear;
-webkit-font-smoothing: subpixel-antialiased;
}
.btn:hover,
.btn:focus,
.button:hover,
.button:focus,
.form-submit:hover,
.form-submit:focus {
text-decoration: none;
color: #fff;
background-color: #555;
}
.btn:active,
.button:active,
.form-submit:active {
background-color: #111;
}

.online-template-link { display: none; }
Expand Down Expand Up @@ -776,6 +808,13 @@ ul.nme-setting-panels-tabs li a.is-active {
.nme-container table[width="100%"] {
width: 100%;
}
.nme-container tr,
.nme-container tr:hover {
background: none;
}
.nme-container td {
height: auto;
}
.nme-mail-container {
max-width: 680px;
border-collapse: collapse;
Expand Down
6 changes: 1 addition & 5 deletions tests/playwright/tests/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ async function setParticipantNum(page, page_title, event_id, full_participant='5
// capture the topest participant and delete it
await page.locator('div#participantSearch>table>tbody>tr').first().getByRole('link', { name: 'Delete' }).click();
await page.locator('[id="_qf_Participant_next-bottom"]').click();
wait(2000);
}
else{
// register new participant
Expand Down Expand Up @@ -179,13 +178,10 @@ async function setParticipantNum(page, page_title, event_id, full_participant='5
locator = pageCreateContact.locator(element);
await findElement(pageCreateContact, element);
await locator.click();
await expect(page.locator('.crm-error')).toHaveCount(0);
console.log('Fail to find element matching selector: .crm-error');
wait(2000);
await expect(pageCreateContact.locator('#page-title')).toHaveText(`${firstName} ${lastName}`);
console.log('Page title correct.');
// back to event page
response = await page.goto(`/civicrm/event/search?reset=1&force=1&event=${event_id}`);
await expect(response.status()).toBe(200);
await expect(page).toHaveTitle(page_title);
}
// read current the number of participant again
Expand Down

0 comments on commit 34f5b4b

Please sign in to comment.