CiviCRM Core issueshttps://lab.civicrm.org/dev/core/-/issues2019-03-18T01:07:09Zhttps://lab.civicrm.org/dev/core/-/issues/706Edit contribution : wrong decimal separator on total_amount for participant(s)2019-03-18T01:07:09ZwouterhEdit contribution : wrong decimal separator on total_amount for participant(s)When I want to register a participant payment, I can not save it because the amount is not in a valid format. There should be a comma instead of a point sign.
This does work for membership payments.![problem_participant_contribution](/u...When I want to register a participant payment, I can not save it because the amount is not in a valid format. There should be a comma instead of a point sign.
This does work for membership payments.![problem_participant_contribution](/uploads/40e1cc7f95b63593d554a5cda946db14/problem_participant_contribution.png)5.13.0https://lab.civicrm.org/dev/core/-/issues/704Missing links to cancel recurring payments (regression .. sorta)2019-04-26T23:06:46ZeileenMissing links to cancel recurring payments (regression .. sorta)As a result of https://github.com/civicrm/civicrm-core/commit/c6d558dca61dc68a3b832ad2bf34dc18b4cca4e2 links no longer show an option to cancel recurrings if there is no payment processor. You could argue the toss here but it seems reas...As a result of https://github.com/civicrm/civicrm-core/commit/c6d558dca61dc68a3b832ad2bf34dc18b4cca4e2 links no longer show an option to cancel recurrings if there is no payment processor. You could argue the toss here but it seems reasonable to thing people would create these rows by api (as we have) to represent recurrings that iteract with other code and which they might wish to cancel
@mattwire I think it might make sense for
CRM_Financial_BAO_PaymentProcessor::getProcessorForEntity
to return the dummy processor (0 => CRM_Core_Manual have that be supportsCancelRecurring = TRUE
- we load the 0 processor in quite a few other places & I see it as something of a standard5.13.0https://lab.civicrm.org/dev/core/-/issues/699New Organisation: "Contact Type" dropdown disappears when fields validation o...2019-03-18T19:59:39ZPradeep Nayakpradpnayak@gmail.comNew Organisation: "Contact Type" dropdown disappears when fields validation occurs* Navigate to Contacts→New Organisation→New Team
* Take a look at the "Contact Type" dropdown
* Click "Save" without filling in any fields
* Take a look at the "Contact Type" dropdown again
**Result:** the "Contact Type" dropdown disapp...* Navigate to Contacts→New Organisation→New Team
* Take a look at the "Contact Type" dropdown
* Click "Save" without filling in any fields
* Take a look at the "Contact Type" dropdown again
**Result:** the "Contact Type" dropdown disappeared. Please take a look at the attached video.
**Expected result:** the "Contact Type" dropdown should stay in its place5.13.0https://lab.civicrm.org/dev/core/-/issues/688Contacts -> New Email give Unknown Error in Smarty when Allow Mail to be sent...2019-03-21T08:26:23ZspalmstromContacts -> New Email give Unknown Error in Smarty when Allow Mail to be sent from logged in contact's email address disabledI raised this issue in [StackExchange](https://civicrm.stackexchange.com/questions/27901/contacts-new-email-give-unknown-error-in-smarty-when-allow-mail-to-be-sent-fr) some time ago, but didn't get a response. I was able to reproduce it...I raised this issue in [StackExchange](https://civicrm.stackexchange.com/questions/27901/contacts-new-email-give-unknown-error-in-smarty-when-allow-mail-to-be-sent-fr) some time ago, but didn't get a response. I was able to reproduce it in one of the demo sites: [https://civicrm.demo.civihosting.com/civicrm/activity/email/add?atype=3&action=add&reset=1&context=standalone](https://civicrm.demo.civihosting.com/civicrm/activity/email/add?atype=3&action=add&reset=1&context=standalone). Basically, if you disable *Allow Mail to be sent from logged in user*, you see the error. It will probably arise from *any* disabled Boolean setting as it is generated when a request for a setting value returns FALSE. The 'offending' line is 54 in …/CRM/Core/Smarty/plugins/function.crmSetting.php. Lines 52-57 read:
```
$result = civicrm_api('setting', 'getvalue', $params);
unset($errorScope);
if ($result === FALSE) {
$smarty->trigger_error("Unknown error");
return NULL;
}
```
So, *any* setting returning FALSE will trigger the error. Replacing line 54 with
if ($result === null)
cures the issue, but what other effects does it have?
I am running CiviCRM 5.9.1 under Joomla.5.13.0https://lab.civicrm.org/dev/core/-/issues/664Add new indexes when updating log table schema regardless of engine change2019-03-18T00:07:09ZPatrick Figelpfigel@greenpeace.orgAdd new indexes when updating log table schema regardless of engine changeWhile working on [at.greenpeace.advancedlogtables](https://github.com/greenpeace-cee/at.greenpeace.advancedlogtables), I noticed that the `System.updatelogtables` API call only adds new indexes set by the `alterLogTables` hook when it's ...While working on [at.greenpeace.advancedlogtables](https://github.com/greenpeace-cee/at.greenpeace.advancedlogtables), I noticed that the `System.updatelogtables` API call only adds new indexes set by the `alterLogTables` hook when it's accompanied by an engine change.
That's generally fine when the indexes don't change, but once new ones are added you'd have to temporarily change the engine or apply the new ones manually.
Is there a particular reason why we'd want to keep that behaviour, or can we change it so that new indexes are added regardless of the engine?
I have [a patch](https://github.com/civicrm/civicrm-core/commit/eababeabc1d0e97a809c7c534ce7e5a73a065c65#diff-e0d65cfb03f2d6f003eb4d598ef7e50b) ready for this, but wanted to check if there's agreement on this first.5.13.0https://lab.civicrm.org/dev/core/-/issues/571Can't self-service cancel a recurring contribution made while you're logged in2020-08-12T12:19:57ZJonGoldCan't self-service cancel a recurring contribution made while you're logged inThe self-service recurring payment page is accessible either a) with a checksum, b) if you have "Edit contributions" permission ([code here](https://github.com/civicrm/civicrm-core/blob/master/CRM/Contribute/Form/CancelSubscription.php#L...The self-service recurring payment page is accessible either a) with a checksum, b) if you have "Edit contributions" permission ([code here](https://github.com/civicrm/civicrm-core/blob/master/CRM/Contribute/Form/CancelSubscription.php#L108-L115)).
However, if you're logged in when you create a recurring contribution, the email you receive doesn't contain a checksum ([code here](https://github.com/civicrm/civicrm-core/blob/master/CRM/Core/Payment.php#L1516)). So users without "Edit contributions" permission can't cancel their subscriptions.
I think the implication of allowing a user to cancel their payment via checksum is that we should also allow a user to cancel if the logged-in contact ID matches the contact ID of the recurring contribution. This would also mean on systems where users are logged in, you would have the added benefit of not worrying about expired checksums.
Is there any scenario in which we shouldn't allow a user to cancel a recurring subscription they "own"? If not I'll submit a PR.5.13.0JonGoldJonGoldhttps://lab.civicrm.org/dev/core/-/issues/570New Organisation: "Check For Matching Contact (S)" button does not find match...2019-03-20T02:02:50ZPradeep Nayakpradpnayak@gmail.comNew Organisation: "Check For Matching Contact (S)" button does not find matching recordsTo replicate:
* Log in with user having limited permissions(Access CiviCRM, CRUD all contacts, Access ajax api)
* Navigate to Contacts→New organisation
* Fill in the Organisation Name field with the same value as it is in the organisati...To replicate:
* Log in with user having limited permissions(Access CiviCRM, CRUD all contacts, Access ajax api)
* Navigate to Contacts→New organisation
* Fill in the Organisation Name field with the same value as it is in the organisation from the preconditions
* Click "Check For Matching Contact(s)"
**Result:** there's the "None Found" message.
**Expected result:** the dupes should be found and the following validation message should be displayed: Similar Contacts Found | If the contact you were trying to add is listed below, click their name to view or edit their record![Duplicate_Org_Record](/uploads/51dd5345310f29c545f46090e1423a99/Duplicate_Org_Record.gif)5.13.0https://lab.civicrm.org/dev/core/-/issues/536Contribution tab is slow to render for contacts with many contributions (in l...2019-04-26T23:08:59ZeileenContribution tab is slow to render for contacts with many contributions (in large database)We are finding that the contribution tab is extremely slow to render on contacts with a large number of contributions. While we are taking at a different scale db to most instances (many millions of contacts and the very slow to load con...We are finding that the contribution tab is extremely slow to render on contacts with a large number of contributions. While we are taking at a different scale db to most instances (many millions of contacts and the very slow to load contacts have > 10,000 donation) from my digging the issues that cause the slowness are not limited to us and the query improvements that work for us are generally applicable.
We are seeing maybe 10 queries that take about 6 seconds each. In each case it is possible to reduce the query to around 0.05 seconds with an index hint. The issue is exacerbated by the fact that several of the slower queries run twice each.
I've pasted all the queries below
1.
SELECT COUNT(*) as count,
SUM(total_amount) as amount,
AVG(total_amount) as average,
currency
FROM civicrm_contribution b
LEFT JOIN civicrm_line_item i ON i.contribution_id = b.id AND i.entity_table = 'civicrm_contribution' AND i.financial_type_id NOT IN (3,1,4,2)
WHERE b.contact_id IN (76) AND b.contribution_status_id = 1 AND b.is_test = 0 AND b.receive_date >= 20180101 AND b.receive_date < 20190101
GROUP BY currency;
2.
------------------------------
SELECT count( DISTINCT civicrm_contribution.id ) as rowCount
FROM civicrm_contact contact_a
LEFT JOIN civicrm_contribution ON civicrm_contribution.contact_id = contact_a.id WHERE ( contact_a.id = '76' )
AND (contact_a.is_deleted = 0) ;
3.
------------------------------------
SELECT COUNT( conts.total_amount ) as total_count,
SUM( conts.total_amount ) as total_amount,
AVG( conts.total_amount ) as total_avg,
conts.currency as currency FROM (
SELECT civicrm_contribution.total_amount, COUNT(civicrm_contribution.total_amount) as civicrm_contribution_total_amount_count,
civicrm_contribution.currency FROM civicrm_contact contact_a LEFT JOIN civicrm_contribution ON civicrm_contribution.contact_id = contact_a.id WHERE ( contact_a.id = '76' ) AND (contact_a.is_deleted = 0) AND (contact_a.is_deleted = 0) AND civicrm_contribution.contribution_status_id = 1 GROUP BY civicrm_contribution.id
) as conts
GROUP BY currency;
4.
------------------------------------
SELECT COUNT( conts.total_amount ) as total_count,
SUM( conts.total_amount ) as total_amount,
AVG( conts.total_amount ) as total_avg,
conts.currency as currency, SUBSTRING_INDEX(GROUP_CONCAT(conts.total_amount
ORDER BY conts.civicrm_contribution_total_amount_count DESC SEPARATOR ';'), ';', 1) as amount,
MAX(conts.civicrm_contribution_total_amount_count) as civicrm_contribution_total_amount_count
FROM (SELECT civicrm_contribution.total_amount, COUNT(civicrm_contribution.total_amount) as civicrm_contribution_total_amount_count,
civicrm_contribution.currency
FROM civicrm_contact contact_a LEFT JOIN civicrm_contribution ON civicrm_contribution.contact_id = contact_a.id WHERE ( contact_a.id = '76' ) AND (contact_a.is_deleted = 0) AND (contact_a.is_deleted = 0) AND civicrm_contribution.contribution_status_id = 1
GROUP BY currency, civicrm_contribution.total_amount ORDER BY civicrm_contribution_total_amount_count DESC) as conts
GROUP BY currency;
5.
---------------------------------------
SELECT count(*) as count FROM civicrm_contact contact_a
LEFT JOIN civicrm_contribution ON civicrm_contribution.contact_id = contact_a.id
WHERE ( contact_a.id = '76' ) AND (contact_a.is_deleted = 0) AND (contact_a.is_deleted = 0)
AND civicrm_contribution.contribution_status_id = 1 AND civicrm_contribution.currency = 'AUD';
6.
------------------------------------
SELECT civicrm_contribution.total_amount as median
FROM civicrm_contact contact_a
LEFT JOIN civicrm_contribution ON civicrm_contribution.contact_id = contact_a.id
WHERE ( contact_a.id = '76' )
AND (contact_a.is_deleted = 0)
AND (contact_a.is_deleted = 0) AND civicrm_contribution.contribution_status_id = 1
AND civicrm_contribution.currency = 'AUD'
ORDER BY median LIMIT 0,1;
7.
------------------------------------
SELECT count(*) as count FROM civicrm_contact contact_a LEFT JOIN civicrm_contribution ON civicrm_contribution.contact_id = contact_a.id WHERE ( contact_a.id = '76' ) AND (contact_a.is_deleted = 0) AND (contact_a.is_deleted = 0) AND civicrm_contribution.contribution_status_id = 1 AND civicrm_contribution.currency = 'NZD';
8.
------------------------------------
SELECT civicrm_contribution.total_amount as median
FROM civicrm_contact contact_a LEFT JOIN civicrm_contribution ON civicrm_contribution.contact_id = contact_a.id WHERE ( contact_a.id = '76' ) AND (contact_a.is_deleted = 0) AND (contact_a.is_deleted = 0) AND civicrm_contribution.contribution_status_id = 1 AND civicrm_contribution.currency = 'NZD'
ORDER BY median LIMIT 0,1;
9.
------------------------------------
SELECT count(*) as count FROM civicrm_contact contact_a LEFT JOIN civicrm_contribution ON civicrm_contribution.contact_id = contact_a.id WHERE ( contact_a.id = '76' ) AND (contact_a.is_deleted = 0) AND (contact_a.is_deleted = 0) AND civicrm_contribution.contribution_status_id = 1 AND civicrm_contribution.currency = 'USD';
10.
------------------------------------
SELECT civicrm_contribution.total_amount as median
FROM civicrm_contact contact_a LEFT JOIN civicrm_contribution ON civicrm_contribution.contact_id = contact_a.id WHERE ( contact_a.id = '76' ) AND (contact_a.is_deleted = 0) AND (contact_a.is_deleted = 0) AND civicrm_contribution.contribution_status_id = 1 AND civicrm_contribution.currency = 'USD'
ORDER BY median LIMIT 0,2;
11.
------------------------------------
SELECT COUNT( conts.total_amount ) as cancel_count,
SUM( conts.total_amount ) as cancel_amount,
AVG( conts.total_amount ) as cancel_avg,
conts.currency as currency FROM (
SELECT civicrm_contribution.total_amount, civicrm_contribution.currency FROM civicrm_contact contact_a LEFT JOIN civicrm_contribution ON civicrm_contribution.contact_id = contact_a.id WHERE ( contact_a.id = '76' ) AND (contact_a.is_deleted = 0) AND (contact_a.is_deleted = 0) AND civicrm_contribution.cancel_date IS NOT NULL
GROUP BY civicrm_contribution.id
) as conts
GROUP BY currency;
12.
------------------------------------
SELECT COUNT( conts.total_amount ) as total_count,
SUM( conts.total_amount ) as total_amount,
AVG( conts.total_amount ) as total_avg,
conts.currency as currency FROM (
SELECT civicrm_contribution.total_amount, COUNT(civicrm_contribution.total_amount) as civicrm_contribution_total_amount_count,
civicrm_contribution.currency FROM civicrm_contact contact_a LEFT JOIN civicrm_contribution ON civicrm_contribution.contact_id = contact_a.id WHERE ( contact_a.id = '76' ) AND (contact_a.is_deleted = 0) AND (contact_a.is_deleted = 0) AND civicrm_contribution.contribution_status_id = 1 GROUP BY civicrm_contribution.id
) as conts
GROUP BY currency;
13.
------------------------------------
SELECT COUNT( conts.total_amount ) as total_count,
SUM( conts.total_amount ) as total_amount,
AVG( conts.total_amount ) as total_avg,
conts.currency as currency, SUBSTRING_INDEX(GROUP_CONCAT(conts.total_amount
ORDER BY conts.civicrm_contribution_total_amount_count DESC SEPARATOR ';'), ';', 1) as amount,
MAX(conts.civicrm_contribution_total_amount_count) as civicrm_contribution_total_amount_count
FROM (SELECT civicrm_contribution.total_amount, COUNT(civicrm_contribution.total_amount) as civicrm_contribution_total_amount_count,
civicrm_contribution.currency FROM civicrm_contact contact_a LEFT JOIN civicrm_contribution ON civicrm_contribution.contact_id = contact_a.id WHERE ( contact_a.id = '76' ) AND (contact_a.is_deleted = 0) AND (contact_a.is_deleted = 0) AND civicrm_contribution.contribution_status_id = 1
GROUP BY currency, civicrm_contribution.total_amount ORDER BY civicrm_contribution_total_amount_count DESC) as conts
GROUP BY currency;
14.
------------------------------------
SELECT count(*) as count FROM civicrm_contact contact_a LEFT JOIN civicrm_contribution ON civicrm_contribution.contact_id = contact_a.id WHERE ( contact_a.id = '76' ) AND (contact_a.is_deleted = 0) AND (contact_a.is_deleted = 0) AND civicrm_contribution.contribution_status_id = 1 AND civicrm_contribution.currency = 'AUD';
15.
------------------------------------
SELECT civicrm_contribution.total_amount as median
FROM civicrm_contact contact_a LEFT JOIN civicrm_contribution ON civicrm_contribution.contact_id = contact_a.id WHERE ( contact_a.id = '76' ) AND (contact_a.is_deleted = 0) AND (contact_a.is_deleted = 0) AND civicrm_contribution.contribution_status_id = 1 AND civicrm_contribution.currency = 'AUD'
ORDER BY median LIMIT 0,1;
16.
------------------------------------
SELECT count(*) as count FROM civicrm_contact contact_a LEFT JOIN civicrm_contribution ON civicrm_contribution.contact_id = contact_a.id WHERE ( contact_a.id = '76' ) AND (contact_a.is_deleted = 0) AND (contact_a.is_deleted = 0) AND civicrm_contribution.contribution_status_id = 1 AND civicrm_contribution.currency = 'NZD';
17.
------------------------------------
SELECT civicrm_contribution.total_amount as median
FROM civicrm_contact contact_a LEFT JOIN civicrm_contribution ON civicrm_contribution.contact_id = contact_a.id WHERE ( contact_a.id = '76' ) AND (contact_a.is_deleted = 0) AND (contact_a.is_deleted = 0) AND civicrm_contribution.contribution_status_id = 1 AND civicrm_contribution.currency = 'NZD'
ORDER BY median LIMIT 0,1;
18.
------------------------------------
SELECT count(*) as count FROM civicrm_contact contact_a LEFT JOIN civicrm_contribution ON civicrm_contribution.contact_id = contact_a.id WHERE ( contact_a.id = '76' ) AND (contact_a.is_deleted = 0) AND (contact_a.is_deleted = 0) AND civicrm_contribution.contribution_status_id = 1 AND civicrm_contribution.currency = 'USD';
19.
------------------------------------
SELECT civicrm_contribution.total_amount as median
FROM civicrm_contact contact_a LEFT JOIN civicrm_contribution ON civicrm_contribution.contact_id = contact_a.id WHERE ( contact_a.id = '76' ) AND (contact_a.is_deleted = 0) AND (contact_a.is_deleted = 0) AND civicrm_contribution.contribution_status_id = 1 AND civicrm_contribution.currency = 'USD'
ORDER BY median LIMIT 0,2;
20.
------------------------------------
SELECT COUNT( conts.total_amount ) as cancel_count,
SUM( conts.total_amount ) as cancel_amount,
AVG( conts.total_amount ) as cancel_avg,
conts.currency as currency FROM (
SELECT civicrm_contribution.total_amount, civicrm_contribution.currency FROM civicrm_contact contact_a LEFT JOIN civicrm_contribution ON civicrm_contribution.contact_id = contact_a.id WHERE ( contact_a.id = '76' ) AND (contact_a.is_deleted = 0) AND (contact_a.is_deleted = 0) AND civicrm_contribution.cancel_date IS NOT NULL
GROUP BY civicrm_contribution.id
) as conts
GROUP BY currency;
21.
------------------------------------
SELECT a.id as `id`, a.contact_id as `contact_id`, a.amount as `amount`, a.currency as `currency`, a.frequency_unit as `frequency_unit`, a.frequency_interval as `frequency_interval`, a.installments as `installments`, a.start_date as `start_date`, a.create_date as `create_date`, a.modified_date as `modified_date`, a.cancel_date as `cancel_date`, a.end_date as `end_date`, a.processor_id as `processor_id`, a.payment_token_id as `payment_token_id`, a.trxn_id as `trxn_id`, a.invoice_id as `invoice_id`, a.contribution_status_id as `contribution_status_id`, a.is_test as `is_test`, a.cycle_day as `cycle_day`, a.next_sched_contribution_date as `next_sched_contribution_date`, a.failure_count as `failure_count`, a.failure_retry_date as `failure_retry_date`, a.auto_renew as `auto_renew`, a.payment_processor_id as `payment_processor_id`, a.financial_type_id as `financial_type_id`, a.payment_instrument_id as `payment_instrument_id`, a.campaign_id as `campaign_id`, a.is_email_receipt as `is_email_receipt`
FROM civicrm_contribution_recur a
WHERE (a.contact_id = "76") AND (a.contribution_status_id IN ("3", "10", "7", "1"))
ORDER BY a.is_test, a.start_date DESC;
22.
------------------------------------
SELECT SQL_CALC_FOUND_ROWS ccs.id, ccs.amount as amount,
ccs.contribution_id,
ccs.pcp_id,
ccs.pcp_display_in_roll,
ccs.pcp_roll_nickname,
ccs.pcp_personal_note,
ccs.soft_credit_type_id,
sov.label as sct_label,
cc.receive_date,
cc.contact_id as contributor_id,
cc.contribution_status_id as contribution_status_id,
cov.label as contribution_status,
cp.title as pcp_title,
cc.currency,
contact.display_name as contributor_name,
cct.name as financial_type
FROM civicrm_contribution_soft ccs
LEFT JOIN civicrm_contribution cc
ON ccs.contribution_id = cc.id
LEFT JOIN civicrm_pcp cp
ON ccs.pcp_id = cp.id
LEFT JOIN civicrm_contact contact ON
ccs.contribution_id = cc.id AND cc.contact_id = contact.id
LEFT JOIN civicrm_financial_type cct ON cc.financial_type_id = cct.id
LEFT JOIN civicrm_option_value sov ON sov.option_group_id = %3 AND ccs.soft_credit_type_id = sov.value
LEFT JOIN civicrm_option_value cov ON cov.option_group_id = %4 AND cc.contribution_status_id = cov.value
WHERE cc.is_test = %2 AND ccs.contact_id = %1 ORDER BY cc.receive_date DESC ;
23.
------------------------------------
SELECT count( x.id ) count FROM (
SELECT contribution.id AS id
FROM civicrm_contribution contribution
LEFT JOIN civicrm_line_item i ON i.contribution_id = contribution.id AND i.entity_table = 'civicrm_contribution' AND i.financial_type_id NOT IN (3,1,4,2)
WHERE contribution.is_test = 0 AND contribution.contact_id = 76
AND contribution.financial_type_id IN (3,1,4,2)
AND i.id IS NULL UNION
SELECT contribution.id
FROM civicrm_contribution contribution INNER JOIN civicrm_contribution_soft softContribution
ON ( contribution.id = softContribution.contribution_id )
WHERE contribution.is_test = 0 AND softContribution.contact_id = 76 ) x;5.13.0https://lab.civicrm.org/dev/core/-/issues/502DB error "no such field" when executing actions on a sorted contact search re...2019-08-23T07:53:16ZjensschuppeDB error "no such field" when executing actions on a sorted contact search result with search profileSteps to reproduce:
- Create a profile with e.g. the postal code field of the primary address
- Perform a contact search using this profile for displaying the results
- Sort the result by the postal code field
- Tick the "all # records"...Steps to reproduce:
- Create a profile with e.g. the postal code field of the primary address
- Perform a contact search using this profile for displaying the results
- Sort the result by the postal code field
- Tick the "all # records" radio button
- Choose any action to perform on the result (e.g. "Print PDF document")
The result is a "DB error: no such field" for the "1-postal_code" field. Error details:
```
Array
(
[callback] => Array
(
[0] => CRM_Core_Error
[1] => handle
)
[code] => -19
[message] => DB Error: no such field
[mode] => 16
[debug_info] => SELECT contact_a.id as contact_id FROM civicrm_contact contact_a WHERE (contact_a.is_deleted = 0) ORDER BY `1-postal_code` asc, `contact_a`.`id` [nativecode=1054 ** Unknown column '1-postal_code' in 'order clause']
[type] => DB_Error
[user_info] => SELECT contact_a.id as contact_id FROM civicrm_contact contact_a WHERE (contact_a.is_deleted = 0) ORDER BY `1-postal_code` asc, `contact_a`.`id` [nativecode=1054 ** Unknown column '1-postal_code' in 'order clause']
[to_string] => [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT contact_a.id as contact_id FROM civicrm_contact contact_a WHERE (contact_a.is_deleted = 0) ORDER BY `1-postal_code` asc, `contact_a`.`id` [nativecode=1054 ** Unknown column '1-postal_code' in 'order clause']"]
)
```
The generated query is missing the JOINs for the `civicrm_address` table, resulting in the postal_code field not being part of the result set to be ordered by. The JOIN is not being added to the query in `CRM_Contact_BAO_Query::prepareOrderBy()` due to the field being named `1-postal_code` and the code expects the field being named `postal_code` for adding relationships to the `civicrm_address` table.
The exception is being raised in [`CRM_Contact_BAO_Query::searchQuery`](https://lab.civicrm.org/dev/core/blob/master/CRM/Contact/BAO/Query.php#L4958).
Stepping through the code, this seems to also happen when ordering the search result, but the exception is then being caught in [`CRM_Contact_Selector::fillupPrevNextCache()`](https://lab.civicrm.org/dev/core/blob/master/CRM/Contact/Selector.php#L1048), following a `$this->rebuildPreNextCache()` call to re-create the query.5.13.0https://lab.civicrm.org/dev/core/-/issues/499Custom Field Checkbox value renders empty if the values are randomly sorted2019-04-05T21:12:33ZbgmCustom Field Checkbox value renders empty if the values are randomly sortedHow to reproduce:
* Create a new Alphanumeric/Checkbox custom field
* Create new options with this specific order:
![Capture_d_écran_de_2018-11-01_14-36-36](/uploads/5f8e93a00ed763c5ec3b835de68b4ae5/Capture_d_écran_de_2018-11-01_14-36-...How to reproduce:
* Create a new Alphanumeric/Checkbox custom field
* Create new options with this specific order:
![Capture_d_écran_de_2018-11-01_14-36-36](/uploads/5f8e93a00ed763c5ec3b835de68b4ae5/Capture_d_écran_de_2018-11-01_14-36-36.png)
(Values are prefixed with '0' because back in the day, the advanced search would consider that, for example, "9" also matches "99", because of the sql query `custom_field like '%9%'`, but that's another topic.)
Result: the custom field renders empty.
![custom-fields-rendering-empty](/uploads/ba015b59f0ad1e188b9884c1d0601008/custom-fields-rendering-empty.gif)
PS: this seems related, but is not the same issue: #286 (and that issue is for 4.6)5.13.0bgmbgmhttps://lab.civicrm.org/dev/core/-/issues/433Queries combining multiple text labels using REGEXP do not escape regular exp...2019-12-15T05:25:58ZAgilewareQueries combining multiple text labels using REGEXP do not escape regular expression metacharactersMost obvious example of this is the "Fee Level" options for events.
We have a site that had set their price set option like:
Price set option name - $120 (GST incl)
This fails during search, either because of the characters after the ...Most obvious example of this is the "Fee Level" options for events.
We have a site that had set their price set option like:
Price set option name - $120 (GST incl)
This fails during search, either because of the characters after the $ end-of-string match, or because (GST incl) is interpreted as a sub-expression rather than matching the parentheses when it's selected as a fee level to search for.
Currently we're working on a solution using preg_quote.
Agileware Ref: CIVICRM-9905.13.0https://lab.civicrm.org/dev/core/-/issues/314Transfer picks up the deleted contact ID basically transferring to the wrong ...2019-03-23T20:47:10ZaniesshsethhTransfer picks up the deleted contact ID basically transferring to the wrong contactTransfer picks up the deleted contact ID basically transferring to the wrong contact. We should be checking if the contact related to that email is deleted or notTransfer picks up the deleted contact ID basically transferring to the wrong contact. We should be checking if the contact related to that email is deleted or not5.13.0https://lab.civicrm.org/dev/core/-/issues/288Use the correct membership date for the notification that appear after comple...2019-04-01T21:27:31Zomar_compucorpUse the correct membership date for the notification that appear after completing the membership payment in case pre hook is usedSuppose you have an extension that implements **hook_civicrm_pre** on membership entity that add 1 year (or whatever amount of time) to the membership new end date whenever someone completed a pending payment for the membership, Based on...Suppose you have an extension that implements **hook_civicrm_pre** on membership entity that add 1 year (or whatever amount of time) to the membership new end date whenever someone completed a pending payment for the membership, Based on this assume the following example :
1- You created a pending membership starts today (27/7/2018) and ends in 1 year (26/7/2019).
2- You changed this membership payment (contribution) from "pending" to "completed".
Now without the hook implementation as explained above, the following message will appear :
```
the contribution record has been saved.
Membership for "CONTACT NAME" has been updated. The membership End Date is July 26th, 2019.
```
and the membership status will be change from Pending to New, And the end date of the membership will be similar to the one shown in the notification message which is 26/7/2019 which is all good.
But when you have the pre hook implemented as suggest above, the membership end date will be 26/7/2020 (since the hook add one year to the end date) but the notification message will still indicate the old end date which is 26/7/2019. This is wrong and the notification message should show the correct end date that reflects the membership actual end date.5.13.0https://lab.civicrm.org/dev/core/-/issues/3406Allow duplicate backend registration when event has "allow same participant e...2022-04-22T16:23:05ZbgmAllow duplicate backend registration when event has "allow same participant emails"We have the following use-case:
* Organisation using CiviEvent for a box office, i.e. to sell tickets for concerts
* People may buy multiple tickets for concerts, and often not at the same time.
For example, they may have bought a tick...We have the following use-case:
* Organisation using CiviEvent for a box office, i.e. to sell tickets for concerts
* People may buy multiple tickets for concerts, and often not at the same time.
For example, they may have bought a ticket during pre-sales, then later bought a ticket as a gift for a friend.
The front-end allows this, thanks for the "allow same participant emails". However the backend does not validate this option. When adding a backend registration, if the participant has already bought a ticket, the admin will get an error message: "This contact has already been assigned to this event."
Looking at Stack Exchange, I found this thread:
https://civicrm.stackexchange.com/questions/15826/enable-multiple-event-registration-for-same-purchaser-participant
Since we use the Event Cart and the [boxoffice](https://lab.civicrm.org/extensions/boxoffice) extension, I implemented a workaround here:
https://lab.civicrm.org/extensions/boxoffice/commit/526703f40c772930bac18e16f71e918e5bd50fb1#d8fbb70d3d7f43c0bde3f9f1385c3d03e740a39f_0_79
but we could avoid all those overrides by adding those 4 lines of code to CRM_Event_Form_Participant.
cc @cmtool5.17.0https://lab.civicrm.org/dev/core/-/issues/3405Event Templates: do not auto-populate the Start Date / End Date2022-04-22T16:23:02ZbgmEvent Templates: do not auto-populate the Start Date / End DateWhen creating an event using an event template, the Start Date is automatically set to the date when the template was created.
To reproduce:
* Create an Event Template (Administer > Events > Event Templates)
* Wait one day, or set the ...When creating an event using an event template, the Start Date is automatically set to the date when the template was created.
To reproduce:
* Create an Event Template (Administer > Events > Event Templates)
* Wait one day, or set the `start_date` to some past date (templates are saved as regular events in the `civicrm_event` database table).
* Create a new Event, and use the template that was created.
* Notice how the start date is automatically set.
This might not sound like a big deal, but when the event template was created in 2015, it gets pretty annoying to have to also click to change the year (and it's easy to overlook).
This was also reported on Stack Exchange:
https://civicrm.stackexchange.com/questions/28159/event-template-start-date
cc @justinfreeman @cividesk @lcdweb (because you seem to be using Events a lot)5.17.0https://lab.civicrm.org/dev/core/-/issues/3373Event Cart: does not save participant custom fields on checkout2022-04-22T16:22:03ZbgmEvent Cart: does not save participant custom fields on checkoutHow to reproduce:
* Create a custom group for Participants, add a custom field in it
* Create a profile for participants: first name, last name, your-participant-custom-field. Don't set a default value.
* Add an event to cart, checkout....How to reproduce:
* Create a custom group for Participants, add a custom field in it
* Create a profile for participants: first name, last name, your-participant-custom-field. Don't set a default value.
* Add an event to cart, checkout.
Result: the your-participant-custom-field will not have been saved.5.17.0bgmbgmhttps://lab.civicrm.org/dev/core/-/issues/1226Smart groups: Relative date filters saved incorrectly2019-09-03T06:50:14ZPradeep Nayakpradpnayak@gmail.comSmart groups: Relative date filters saved incorrectly(*Original title: "Regression: Smart group with Change log criteria is not saved."*)
If you create a smart group which uses a relative date filter (e.g. "Last 60 days" or "This calendar current year"), the relative date filter is not sa...(*Original title: "Regression: Smart group with Change log criteria is not saved."*)
If you create a smart group which uses a relative date filter (e.g. "Last 60 days" or "This calendar current year"), the relative date filter is not saved correctly.
This issue entails two aspects:
1. (*Code update in 5.16.4*) Fix the code so that smart groups are properly saved
2. (*Data cleanup; case-by-case*) Identify any smart-groups which were created or edited in the past month (5.16.x). Determine if they should be updated to use a relative date filter.
The following fields are believed to affected:
* `log_date_relative`
* `pledge_payment_date_relative`
* `pledge_start_date_relative`
* `pledge_end_date_relative`
* `pledge_create_date_relative`
* `member_join_date_relative`
* `member_start_date_relative`
* `member_end_date_relative`
* `birth_date_relative`
* `deceased_date_relative`
* `mailing_date_relative`
* `relation_date_relative`
* `relation_start_date_relative`
* `relation_end_date_relative`
* `relation_action_date_relative`
* `contribution_recur_start_date_relative`
* `contribution_recur_next_sched_contribution_date_relative`
* `contribution_recur_cancel_date_relative`
* `contribution_recur_end_date_relative`
* `contribution_recur_create_date_relative`
* `contribution_recur_modified_date_relative`
* `contribution_recur_failure_retry_date_relative`5.17.0Pradeep Nayakpradpnayak@gmail.comPradeep Nayakpradpnayak@gmail.comhttps://lab.civicrm.org/dev/core/-/issues/1171unreleased regression2019-08-08T01:27:17Zeileenunreleased regressionnew enotices on importing with an import mapping (not to be confused with the pre-existing ones)
https://github.com/civicrm/civicrm-core/pull/14978new enotices on importing with an import mapping (not to be confused with the pre-existing ones)
https://github.com/civicrm/civicrm-core/pull/149785.17.0https://lab.civicrm.org/dev/core/-/issues/1170Fix getLoginURL() for Backdrop2019-08-08T03:16:12ZherbdoolFix getLoginURL() for BackdropBecause of https://github.com/backdrop/backdrop-issues/issues/260, any anonymous visits to `/user` will redirect to `/user/login`. Currently `CRM_Utils_System_Backdrop::getLoginURL()` creates a link to `/user?destination...` and this URL...Because of https://github.com/backdrop/backdrop-issues/issues/260, any anonymous visits to `/user` will redirect to `/user/login`. Currently `CRM_Utils_System_Backdrop::getLoginURL()` creates a link to `/user?destination...` and this URL will automatically try to redirect. And because of Backdrop/Drupal allowing the `?destination` parameter to override other redirects, it will automatically go to that destination instead of staying at `/user` or even `/user/login`
There's probably an easy fix by just changing getLoginURL to point to `/user/login` and no immediate redirect will happen.5.17.0https://lab.civicrm.org/dev/core/-/issues/1135Participants having multiple roles affects maximum event registration count2019-08-05T19:47:12ZDon WijesooriyaParticipants having multiple roles affects maximum event registration countIf you add multiple participant roles for a participant entry, it affects the event full count.
### Steps to reproduce
1. On dmaster, create a new event
2. Enable online registration and set "Max Number of Participants" to 1
3. Go to l...If you add multiple participant roles for a participant entry, it affects the event full count.
### Steps to reproduce
1. On dmaster, create a new event
2. Enable online registration and set "Max Number of Participants" to 1
3. Go to live event registration page. You should be able to register
4. Now add a new registration to a different contact from backend.
5. Once again go to live event registration page. Now it should show the event full message.
6. Go back to the other contact's events. Edit the event participant entry and add another role such as "Host".
7. Now go to the event registration page and you will be able to register for the maxed out event
### Issue
After inspecting `CRM_Event_BAO_Participant::eventFull()` the following line assumes there will only be one value in the field
````php
$where[] = " participant.role_id IN ( '" . implode("', '", $escapedRoles) . "' ) ";
````
Therefore when you have multiple values it won't work properly.
### Solution
I used regular expression code that's used in `CRM_Event_BAO_Query::whereClauseSingle()` under `case 'participant_role_id'`. This is a simple workaround I could think of. Haven't tested in all other scenarios.
````php
$regexp = "([[:cntrl:]]|^)" . implode('([[:cntrl:]]|$)|([[:cntrl:]]|^)', $escapedRoles) . "([[:cntrl:]]|$)";
$where[] = " participant.role_id REGEXP '{$regexp}'";
````5.17.0