When I click Analyse (again)
button on the review page i.e.(civicrm/banking/review?s_list=45) I
get 500 service unavailable error in console
https://www.example.com/civicrm/ajax/rest 500 (Service unavailable (with message))
send @ jquery.js:9664
ajax @ jquery.js:9215
(anonymous) @ crm.ajax.js?p52hox:143
CRM.api @ crm.ajax.js?p52hox:152
analysePayment @ review?s_list=45:752
onclick @ review?s_list=45:685
analysePayment @ review?s_list = 45:752のコードは
CRM.api('BankingTransaction', 'analyselist', query,
{success: function(data) {
console.log(data);
if (!data['is_error']) {
//remove 'execute' bit from URL before reload
var newURL = window.location.href.replace(reload_regex, '');
if (window.location.href == newURL) {
window.location.reload(false);
} else {
window.location = newURL;
}
} else {
cj('<div title="Fout">' + data['error_message'] + '</div>').dialog({
modal: true,
buttons: {
Ok: function() {
window.location = window.location.href.replace(reload_regex, '');
}
}
});
}
}
}
);
上記の問題をデバッグしている間、私はそれを以下の関数 あなたはgithubでここを見つけることができます https://
github。
com/Project60/org.project60.banking/blob/9dc6bdcc486753f70948edfd4ea36df0eb9d2f86/extension/CRM/Banking/Matcher/Engine.php
私が問題と思う正確なコードは、$ continue値が1であることが判明し、if(!$
continue)条件に入っていないので戻り値がfalseになる
foreach ($matchers as $matcher) {
try {
//run matchers to generate suggestions
$logger->setTimer('matcher');
$continue = $this->matchPlugin( $matcher, $context );
$logger->logTime("Matcher [{$matcher->getPluginID()}]", 'matcher');
if (!$continue) {
$lock->release();
$logger->logTime("Matching of btx [{$btx_id}]", 'matcher');
return true;
}
今私はそれを真実にする方法を見つけ出す必要があるので、私は寄付にマッチするオプションを見ることができます
私が使用しているマッチャーは https://github.com/
Project60/org.project60.banking/blob/9dc6bdcc486753f70948edfd4ea36df0eb9d2f86/configuration_database/matcher/default/EnglishDefaults.json
これは、$
continue値がfalseになるようにjsonを変更する必要がある場所だと思いますが、どのように変更でき、各キー値ペアが具体的に何をするのかは不明です。
/**
* Run this BTX through the matchers
*
* @param CRM_Banking_BAO_BankTransaction $btx
* @param bool $override_processed Set this to TRUE if you want to re-match processed transactions.
* This will destroy all records of the execution!
*/
public function match( $btx_id, $override_processed = FALSE ) {
//TODO: timeout is 30s - do we need a setting here?
$lock_timeout = 30.0;
$lock = CRM_Utils_BankingSafeLock::acquireLock('org.project60.banking.tx'.'-'.$btx_id, $lock_timeout);
if (empty($lock)) {
error_log("org.project60.banking - couldn't acquire lock. Timeout is $lock_timeout.");
return false;
}
//load btx
$btx = new CRM_Banking_BAO_BankTransaction();
$btx->get('id', $btx_id);
if (!$override_processed) {
//don't match already executed transactions...
$processed_status_id = banking_helper_optionvalueid_by_groupname_and_name('civicrm_banking.bank_tx_status', 'Processed');
$ignored_status_id = banking_helper_optionvalueid_by_groupname_and_name('civicrm_banking.bank_tx_status', 'Ignored');
if ($btx->status_id == $processed_status_id || $btx->status_id == $ignored_status_id) {
//will not match already executed transactions
$lock->release();
return true;
}
}
//reset the BTX suggestion list
$btx->resetSuggestions();
//reset the cache/context object
$context = new CRM_Banking_Matcher_Context( $btx );
$logger = CRM_Banking_Helpers_Logger::getLogger();
//run through the list of matchers
$logger->setTimer('matching');
//run through the list of matchers
$all_matchers = $this->getMatchers();
if (empty($all_matchers)) {
CRM_Core_Session::setStatus(ts("No matcher plugins configured!"), ts('No processors'), 'alert');
} else {
foreach ($all_matchers as $weight => $matchers) {
foreach ($matchers as $matcher) {
try {
//run matchers to generate suggestions
$logger->setTimer('matcher');
$continue = $this->matchPlugin( $matcher, $context );
$logger->logTime("Matcher [{$matcher->getPluginID()}]", 'matcher');
if (!$continue) {
$lock->release();
$logger->logTime("Matching of btx [{$btx_id}]", 'matcher');
return true;
}
//check if we can execute the suggestion right aways
$abort = $this->checkAutoExecute($matcher, $btx);
if ($abort) {
$logger->logDebug("Matcher [{$matcher->getPluginID()}] executed automatically.");
$lock->release();
$logger->logTime("Matching of btx [{$btx_id}]", 'matcher');
return false;
}
} catch (Exception $e) {
$matcher_id = $matcher->getPluginID();
error_log("org.project60.banking - Exception during the execution of matcher [$matcher_id], error was: ".$e->getMessage());
$lock->release();
return false;
}
}
}
}
$btx->saveSuggestisons();
//set the status
$newStatus = banking_helper_optionvalueid_by_groupname_and_name('civicrm_banking.bank_tx_status', 'Suggestions');
$btx->status_id = $newStatus;
$btx->setStatus($newStatus);
$lock->release();
$context->destroy();
$logger->logTime("Matching of btx [{$btx_id}]", 'matcher');
return false;
}