CiviCRM Core issues
https://lab.civicrm.org/dev/core/-/issues
2018-12-19T14:11:24Z
https://lab.civicrm.org/dev/core/-/issues/118
Fix where count() is used on an object that isn't an array nor implements Cou...
2018-12-19T14:11:24Z
seamuslee
Fix where count() is used on an object that isn't an array nor implements Countable for php7.2 (tested instances)
```
<error type="PHPUnit_Framework_Error_Warning">CRM_Contribute_Import_Parser_ContributionTest::testImportParserWithSoftCreditsByExternalIdentifier with data set #0 ('.')
count(): Parameter must be an array or an object that...
```
<error type="PHPUnit_Framework_Error_Warning">CRM_Contribute_Import_Parser_ContributionTest::testImportParserWithSoftCreditsByExternalIdentifier with data set #0 ('.')
count(): Parameter must be an array or an object that implements Countable
/home/seamus/buildkit/build/47.demo/sites/all/modules/civicrm/tests/phpunit/CRM/Contribute/Import/Parser/ContributionTest.php:67
/home/seamus/buildkit/build/47.demo/sites/all/modules/civicrm/tests/phpunit/CiviTest/CiviUnitTestCase.php:182
/home/seamus/buildkit/bin/phpunit5:598
</error>
</testcase>
<testcase name="testImportParserWithSoftCreditsByExternalIdentifier with data set #1" assertions="8" time="0.685860">
<error type="PHPUnit_Framework_Error_Warning">CRM_Contribute_Import_Parser_ContributionTest::testImportParserWithSoftCreditsByExternalIdentifier with data set #1 (',')
count(): Parameter must be an array or an object that implements Countable
/home/seamus/buildkit/build/47.demo/sites/all/modules/civicrm/tests/phpunit/CRM/Contribute/Import/Parser/ContributionTest.php:67
/home/seamus/buildkit/build/47.demo/sites/all/modules/civicrm/tests/phpunit/CiviTest/CiviUnitTestCase.php:182
/home/seamus/buildkit/bin/phpunit5:598
</error>
<error type="PHPUnit_Framework_Error_Warning">CRM_Pledge_BAO_PledgePaymentTest::testRetrieveZeroPledeID
count(): Parameter must be an array or an object that implements Countable
/home/seamus/buildkit/build/47.demo/sites/all/modules/civicrm/tests/phpunit/CRM/Pledge/BAO/PledgePaymentTest.php:100
/home/seamus/buildkit/build/47.demo/sites/all/modules/civicrm/tests/phpunit/CiviTest/CiviUnitTestCase.php:182
/home/seamus/buildkit/bin/phpunit5:598
</error>
<error type="PHPUnit_Framework_Error_Warning">CRM_Pledge_BAO_PledgePaymentTest::testRetrieveStringPledgeID
count(): Parameter must be an array or an object that implements Countable
/home/seamus/buildkit/build/47.demo/sites/all/modules/civicrm/tests/phpunit/CRM/Pledge/BAO/PledgePaymentTest.php:113
/home/seamus/buildkit/build/47.demo/sites/all/modules/civicrm/tests/phpunit/CiviTest/CiviUnitTestCase.php:182
/home/seamus/buildkit/bin/phpunit5:598
</error>
<error type="PHPUnit_Framework_Error_Warning">CRM_Pledge_BAO_PledgePaymentTest::testRetrieveKnownPledgeID
count(): Parameter must be an array or an object that implements Countable
/home/seamus/buildkit/build/47.demo/sites/all/modules/civicrm/tests/phpunit/CRM/Pledge/BAO/PledgePaymentTest.php:127
/home/seamus/buildkit/build/47.demo/sites/all/modules/civicrm/tests/phpunit/CiviTest/CiviUnitTestCase.php:182
/home/seamus/buildkit/bin/phpunit5:598
</error>
<error type="PHPUnit_Framework_Error_Warning">CRM_Pledge_BAO_PledgePaymentTest::testDeletePledgePaymentsNormal
count(): Parameter must be an array or an object that implements Countable
/home/seamus/buildkit/build/47.demo/sites/all/modules/civicrm/tests/phpunit/CRM/Pledge/BAO/PledgePaymentTest.php:137
/home/seamus/buildkit/build/47.demo/sites/all/modules/civicrm/tests/phpunit/CiviTest/CiviUnitTestCase.php:182
/home/seamus/buildkit/bin/phpunit5:598
</error>
<error type="PHPUnit_Framework_Error_Warning">CRM_Pledge_BAO_PledgePaymentTest::testDeletePledgePaymentsNullId
count(): Parameter must be an array or an object that implements Countable
/home/seamus/buildkit/build/47.demo/sites/all/modules/civicrm/tests/phpunit/CRM/Pledge/BAO/PledgePaymentTest.php:160
/home/seamus/buildkit/build/47.demo/sites/all/modules/civicrm/tests/phpunit/CiviTest/CiviUnitTestCase.php:182
/home/seamus/buildkit/bin/phpunit5:598
</error>
<error type="PHPUnit_Framework_Error_Warning">CRM_Pledge_BAO_PledgeTest::testRetrieveZeroPledeID
count(): Parameter must be an array or an object that implements Countable
/home/seamus/buildkit/build/47.demo/sites/all/modules/civicrm/tests/phpunit/CRM/Pledge/BAO/PledgeTest.php:106
/home/seamus/buildkit/build/47.demo/sites/all/modules/civicrm/tests/phpunit/CiviTest/CiviUnitTestCase.php:182
/home/seamus/buildkit/bin/phpunit5:598
</error>
</testcase>
<testcase name="testRetrieveStringPledgeID" class="CRM_Pledge_BAO_PledgeTest" file="/home/seamus/buildkit/build/47.demo/sites/all/modules/civicrm/tests/phpunit/CRM/Pledge/BAO/PledgeTest.php" line="112" assertions="1" time="0.143334">
<error type="PHPUnit_Framework_Error_Warning">CRM_Pledge_BAO_PledgeTest::testRetrieveStringPledgeID
count(): Parameter must be an array or an object that implements Countable
/home/seamus/buildkit/build/47.demo/sites/all/modules/civicrm/tests/phpunit/CRM/Pledge/BAO/PledgeTest.php:117
/home/seamus/buildkit/build/47.demo/sites/all/modules/civicrm/tests/phpunit/CiviTest/CiviUnitTestCase.php:182
/home/seamus/buildkit/bin/phpunit5:598
</error>
</testcase>
<testcase name="testRetrieveKnownPledgeID" class="CRM_Pledge_BAO_PledgeTest" file="/home/seamus/buildkit/build/47.demo/sites/all/modules/civicrm/tests/phpunit/CRM/Pledge/BAO/PledgeTest.php" line="123" assertions="1" time="0.165138">
<error type="PHPUnit_Framework_Error_Warning">CRM_Pledge_BAO_PledgeTest::testRetrieveKnownPledgeID
count(): Parameter must be an array or an object that implements Countable
/home/seamus/buildkit/build/47.demo/sites/all/modules/civicrm/tests/phpunit/CRM/Pledge/BAO/PledgeTest.php:147
/home/seamus/buildkit/build/47.demo/sites/all/modules/civicrm/tests/phpunit/CiviTest/CiviUnitTestCase.php:182
/home/seamus/buildkit/bin/phpunit5:598
</error>
</testcase>
<testcase name="testGetPledgeStartDate" class="CRM_Pledge_BAO_PledgeTest" file="/home/seamus/buildkit/build/47.demo/sites/all/modules/civicrm/tests/phpunit/CRM/Pledge/BAO/PledgeTest.php" line="153" assertions="1" time="0.149295">
<error type="PHPUnit_Framework_Error_Deprecated">CRM_Pledge_BAO_PledgeTest::testGetPledgeStartDate
The each() function is deprecated. This message will be suppressed on further calls
/home/seamus/buildkit/build/47.demo/sites/all/modules/civicrm/CRM/Pledge/BAO/Pledge.php:1203
/home/seamus/buildkit/build/47.demo/sites/all/modules/civicrm/tests/phpunit/CRM/Pledge/BAO/PledgeTest.php:163
/home/seamus/buildkit/build/47.demo/sites/all/modules/civicrm/tests/phpunit/CiviTest/CiviUnitTestCase.php:182
/home/seamus/buildkit/bin/phpunit5:598
</error>
```
ping @eileen @monish.deb
5.4.0
https://lab.civicrm.org/dev/core/-/issues/406
5.5.2: Import is not happy on PHP-7.2 (Countable)
2019-01-08T02:47:10Z
Dmitry Smirnov
5.5.2: Import is not happy on PHP-7.2 (Countable)
~~~~
2018/09/25 18:15:04 [error] 33#33: *451 FastCGI sent in stderr: "PHP message: PHP Warning: count(): Parameter must be an array or an object that implements Countable in /usr/share/civicrm/CRM/Contact/Import/Parser.php on line 375
P...
~~~~
2018/09/25 18:15:04 [error] 33#33: *451 FastCGI sent in stderr: "PHP message: PHP Warning: count(): Parameter must be an array or an object that implements Countable in /usr/share/civicrm/CRM/Contact/Import/Parser.php on line 375
PHP message: PHP Warning: count(): Parameter must be an array or an object that implements Countable in /usr/share/civicrm/CRM/Contact/Import/Parser.php on line 387
PHP message: PHP Warning: count(): Parameter must be an array or an object that implements Countable in /usr/share/civicrm/CRM/Contact/Import/Parser.php on line 396
PHP message: PHP Warning: count(): Parameter must be an array or an object that implements Countable in /usr/share/civicrm/CRM/Contact/Import/Parser.php on line 408
PHP message: PHP Warning: count(): Parameter must be an array or an object that implements Countable in /usr/share/civicrm/CRM/Contact/Import/Parser.php on line 417
PHP message: PHP Warning: count(): Parameter must be an array or an object that implements Countable in /usr/share/civicrm/CRM/Contact/Import/Parser.php on line 426
PHP message: PHP Warning: count(): Parameter must be an array or an object that implements Countable in /usr/share/civicrm/CRM/Contact/Import/Parser.php on line 435
PHP message: PHP Warning: count(): Parameter must be an array or an object that implements Countable in /usr/share/civicrm/CRM/Contact/Import/Parser.php on line 444
PHP message: PHP Warning: count(): Parameter must be an array or an object that implements Countable in /usr/share/civicrm/CRM/Contact/Import/Parser.php on line 455
PHP message: PHP Warning: count(): Parameter must be an array or an object that implements Countable in /usr/share/civicrm/CRM/Contact/Import/Parser.php on line 464
PHP message: PHP Warning: count(): Parameter must be an array or an object that implements Countable in /usr/share/civicrm/CRM/Contact/Import/Parser.php on line 476" while reading response header from upstream, client: 192.168.0.2, server: civicrm.local, request: "POST /wp-admin/admin.php?page=CiviCRM&q=civicrm/impor
~~~~
5.8
https://lab.civicrm.org/dev/core/-/issues/638
Manage groups: Error: "API permission check failed for Group/create call; ins...
2019-01-16T14:09:44Z
Pradeep Nayak
pradpnayak@gmail.com
Manage groups: Error: "API permission check failed for Group/create call; insufficient permission" when the user tries to edit some group's details
**Precondition:** The CRM was opened by the user with the role having minimum permission to create group and contact.
The system has, for example, one group
**Steps:**
Click "View contact record"
Click "Contacts" -> "Manage Groups"
T...
**Precondition:** The CRM was opened by the user with the role having minimum permission to create group and contact.
The system has, for example, one group
**Steps:**
Click "View contact record"
Click "Contacts" -> "Manage Groups"
Try to edit Name of the group from the precondition(in-line edit).
**Actual result:** There is an error: "API permission check failed for Group/create call; insufficient permission: require access CiviCRM and edit groups"
No changes are applied.
**Expected result:** Should be able to edit the Group name from Manage group screen.
https://lab.civicrm.org/dev/core/-/issues/673
Add filter for deleted contacts on Repeat Contributions Report
2019-01-23T08:30:46Z
francescbassas
Add filter for deleted contacts on Repeat Contributions Report
By default Repeat Contributions Report shows contributions for contacts in trash. It is a behavior that can lead to problems and, in our view, should be just the opposite.
By default Repeat Contributions Report shows contributions for contacts in trash. It is a behavior that can lead to problems and, in our view, should be just the opposite.
https://lab.civicrm.org/dev/core/-/issues/650
Use popups for links
2019-01-24T18:14:59Z
Don Wijesooriya
Use popups for links
Update links on following 2 templates to work as popups:
1. templates/CRM/Contribute/Page/ContributionRecur.tpl Membership link
2. templates/CRM/Member/Form/MembershipView.tpl Recurring Contribution link
# Steps to reproduce:
1. Creat...
Update links on following 2 templates to work as popups:
1. templates/CRM/Contribute/Page/ContributionRecur.tpl Membership link
2. templates/CRM/Member/Form/MembershipView.tpl Recurring Contribution link
# Steps to reproduce:
1. Create a recurring contribution manually
```php
$result = civicrm_api3('ContributionRecur', 'create', [
'contact_id' => contact_id_of_your_choosing,
'amount' => 50,
'frequency_interval' => 1,
]);
```
2. Create a membership
3. Link the recurring contribution to the membership
```php
$result = civicrm_api3('Membership', 'create', [
'id' => id_of_the_membership,
'contribution_recur_id' => id_of_the_recurring_contribution,
]);
```
### Recurring Contribution View (CRM_Contribute_Page_ContributionRecur)
Clicking on the link to membership opens it in a new page
![recur](/uploads/ffcec3eda0092de1b6da55f50cc3e145/recur.png)
### Membership View (CRM_Member_Form_MembershipView)
Clicking on the link to recurring contribution opens it in a new page
![membership](/uploads/ed50a7f1e857d298b7a169cbab2ddde4/membership.png)
## Fix
* In templates/CRM/Contribute/Page/ContributionRecur.tpl added class `crm-popup` to the hyperlink in following code block
```
{if $recur.membership_id}
<tr>
<td class="label">{ts}Membership{/ts}</td>
<td><a class="crm-hover-button" href='{crmURL p="civicrm/contact/view/membership" q="action=view&reset=1&cid=`$contactId`&id=`$recur.membership_id`&context=membership&selectedChild=member"}'>{$recur.membership_name}</a></td>
</tr>
{/if}
```
* In templates/CRM/Member/Form/MembershipView.tpl added class `crm-popup` to the hyperlink in following code block
```
{if $contribution_recur_id}
<tr>
<td class="label">{ts}Recurring Contribution{/ts}</td>
<td>
<a class="crm-hover-button" href='{crmURL p="civicrm/contact/view/contributionrecur" q="reset=1&id=`$contribution_recur_id`&cid=`$contactId`&context=contribution"}'>View Recurring Contribution
</a>
</td>
</tr>
{/if}
```
https://lab.civicrm.org/dev/core/-/issues/535
Do not allow to edit recurring contribution amount if one line item exist
2019-01-28T05:17:49Z
madhavi
Do not allow to edit recurring contribution amount if one line item exist
This is an improvement in https://issues.civicrm.org/jira/browse/CRM-16398
Currently CiviCRM allows to edit recurring contribution amount if one related contribution exists.
The Recurring contribution edit UI should not allow to edit the...
This is an improvement in https://issues.civicrm.org/jira/browse/CRM-16398
Currently CiviCRM allows to edit recurring contribution amount if one related contribution exists.
The Recurring contribution edit UI should not allow to edit the total amount for transactions with one line item.
**Technical Details:**
1. In /Contribute/Form/UpdateSubscription.php updated the check to >= 1 (Greater than or equal to 1)
https://lab.civicrm.org/dev/core/-/issues/693
On contact summary page, on submitting a 'New Case' form doesn't redirect to ...
2019-02-04T22:04:19Z
Monish Deb
On contact summary page, on submitting a 'New Case' form doesn't redirect to 'Manage Case' screen
Steps to replicate:
1. Go to Case tab in Contact summary page.
2. Click on 'Add Case' button which opens the 'New Case' backoffice form in a popup.
3. Fill and submit the form which simply closes the popup and does not redirect to the 'M...
Steps to replicate:
1. Go to Case tab in Contact summary page.
2. Click on 'Add Case' button which opens the 'New Case' backoffice form in a popup.
3. Fill and submit the form which simply closes the popup and does not redirect to the 'Manage Case' screen. Although the redirect url is declared in [here](https://github.com/civicrm/civicrm-core/blob/master/CRM/Case/Form/Activity/OpenCase.php#L355)
Solution:
Add 'no-popup' class to 'Add Case' button so that 'New Case' backoffice form always opens in a new window and thus redirects to 'Manage Case' on submit
5.11
Monish Deb
Monish Deb
https://lab.civicrm.org/dev/core/-/issues/255
Changes to copied event location reflects in original event location
2019-02-05T04:25:52Z
yashodha
Changes to copied event location reflects in original event location
Steps to replicate:
1. Create an event X with location A.
2. Create copy of event X say Y and go to location tab for event Y (which will now show location A).
3. Click *Create new location* radio and then click *Use existing location*, ...
Steps to replicate:
1. Create an event X with location A.
2. Create copy of event X say Y and go to location tab for event Y (which will now show location A).
3. Click *Create new location* radio and then click *Use existing location*, choose option B.
4. Check event X also has location B.
5.5.0
yashodha
yashodha
https://lab.civicrm.org/dev/core/-/issues/695
Custom Search results selection failure
2019-02-05T04:27:09Z
ayduns
aidan.saunders@squiffle.uk
Custom Search results selection failure
Symptom: When viewing custom search results, it is possible to select all records, but individual selections do not change the count and enable action dropdowns. This does not occur for all custom searches.
Analysis: The selections are...
Symptom: When viewing custom search results, it is possible to select all records, but individual selections do not change the count and enable action dropdowns. This does not occur for all custom searches.
Analysis: The selections are saved by `CRM_Core_PrevNextCache_Sql::markSelection()` which updates the prevnext cache. However, if the results are not already in the prevnext cache, the selections are not saved. The cache is filled by `CRM_Contact_Selector::fillupPrevNextCache()` which it does by taking the result of the custom search's `contactIDs()` method and doing a string replace to form the query used for the cache and if the string replace fails, no results are saved in the cache and therefore individual results cannot be selected.
The string replacement method is case sensitive, so if the custom search specifies `contact_a.id as contact_id` then the replacement works, but specifying `contact_a.id AS contact_id` fails.
The whole approach seems rather fragile but making the string replacement case insensitive reduces that slightly, and hopefully saves developer frustration trying to track down why an innocuous select statement case change results in UI failures.
5.10
ayduns
aidan.saunders@squiffle.uk
ayduns
aidan.saunders@squiffle.uk
https://lab.civicrm.org/dev/core/-/issues/609
Can't view "Advanced Search" links on Mailing Report without "View All Contac...
2019-02-05T14:07:11Z
JonGold
Can't view "Advanced Search" links on Mailing Report without "View All Contacts" permission
It appears that the "Advanced Search" link (see screenshot) doesn't appear on mailing reports unless you have the "View All Contacts" permission. This seems odd because the "Report" link is NOT restricted. The only reason I can think o...
It appears that the "Advanced Search" link (see screenshot) doesn't appear on mailing reports unless you have the "View All Contacts" permission. This seems odd because the "Report" link is NOT restricted. The only reason I can think of for wanting to restrict this is to prevent someone thinking they have a complete list of contacts that received a mailing when they didn't. I'd argue that a) folks with access to less than the whole database typically understand this; b) the same issue would be present on reports.
I propose we remove [the permission check](https://github.com/civicrm/civicrm-core/blob/master/CRM/Mailing/BAO/Mailing.php#L2182) that controls the display of the "Advanced Search" link.
![Selection_721](/uploads/576ddcc9b35d34870056ef7316439d9b/Selection_721.png)
https://lab.civicrm.org/dev/core/-/issues/714
Manage groups: Error: "API permission check failed for Group/create call; ins...
2019-02-13T19:30:24Z
Pradeep Nayak
pradpnayak@gmail.com
Manage groups: Error: "API permission check failed for Group/create call; insufficient permission" when the user tries to edit some group's details
Steps:
* Click "View contact record"
* Click "Contacts" -> "Manage Groups"
* Try to edit Name of the group from the precondition.
**Actual result:** There is an error: "API permission check failed for Group/create call; insufficient pe...
Steps:
* Click "View contact record"
* Click "Contacts" -> "Manage Groups"
* Try to edit Name of the group from the precondition.
**Actual result:** There is an error: "API permission check failed for Group/create call; insufficient permission: require access CiviCRM and edit groups"
**Expected result:** User shouldn't be allowed to use inline edit for group update when they don't have permission.
5.12.0
https://lab.civicrm.org/dev/core/-/issues/683
Incorrectly encoded state and country names
2019-02-15T16:47:10Z
mfb
Incorrectly encoded state and country names
Civi 4.3.alpha1 added some new states:
```
(@country_id, '072', 'Pļaviņu novads'),
(@country_id, '046', 'Kokneses novads'),
(@country_id, '065', 'Neretas novads'),
(@country_id, '092', 'Skrīveru novads'),
(@country_id, '007', 'Alūks...
Civi 4.3.alpha1 added some new states:
```
(@country_id, '072', 'Pļaviņu novads'),
(@country_id, '046', 'Kokneses novads'),
(@country_id, '065', 'Neretas novads'),
(@country_id, '092', 'Skrīveru novads'),
(@country_id, '007', 'Alūksnes novads'),
(@country_id, '009', 'Apes novads'),
(@country_id, '015', 'Balvu novads'),
(@country_id, '108', 'Viļakas novads'),
(@country_id, '014', 'Baltinavas novads'),
(@country_id, '082', 'Rug�ju novads'),
etc.
```
but according to the install schema these should be:
```
(NULL, 1119, "072", "Pļaviņu novads"),
(NULL, 1119, "046", "Kokneses novads"),
(NULL, 1119, "065", "Neretas novads"),
(NULL, 1119, "092", "Skrīveru novads"),
(NULL, 1119, "007", "Alūksnes novads"),
(NULL, 1119, "009", "Apes novads"),
(NULL, 1119, "015", "Balvu novads"),
(NULL, 1119, "108", "Viļakas novads"),
(NULL, 1119, "014", "Baltinavas novads"),
(NULL, 1119, "082", "Rugāju novads"),
...
```
I also found one wrongly-encoded country name in my instance. I didn't look into why but maybe no character encoding was specified in the sql commands and it fell back to (wrong) default?
```
mysql> SET NAMES utf8;
Query OK, 0 rows affected (0.00 sec)
mysql> SELECT name FROM civicrm_country WHERE name LIKE '%Saint Barth%';
+---------------------+
| name |
+---------------------+
| Saint Barthélemy |
+---------------------+
1 row in set (0.00 sec)
mysql> SELECT CONVERT(BINARY CONVERT(name USING latin1) USING utf8) FROM civicrm_country WHERE name LIKE '%Saint Barth%';
+-------------------------------------------------------+
| CONVERT(BINARY CONVERT(name USING latin1) USING utf8) |
+-------------------------------------------------------+
| Saint Barthélemy |
+-------------------------------------------------------+
1 row in set (0.00 sec)
```
https://lab.civicrm.org/dev/core/-/issues/720
Performance change approved - remove mode & median slow queries
2019-02-19T04:53:15Z
eileen
Performance change approved - remove mode & median slow queries
Update - simply removing per decision by @colemanw below....
---------------------------------------------------------------
Original
----------------------------------------------------------------
The calculations done for the summary...
Update - simply removing per decision by @colemanw below....
---------------------------------------------------------------
Original
----------------------------------------------------------------
The calculations done for the summary statistics on the contribution search is currently the biggest point of slowness we are facing. The following stats are generated:
'count' (number completed)
'amount' (total amount of completed)
'avg' (average amount of completed)
'mode' (most common value of completed)
'median' (median value of complete)
'cancel_amount' (total of cancelled)
'cancel_count' (number cancelled)
'cancel_avg' (average amount of cancelled)
These are then grouped by currency.
Of these the count and total amount are highly useful whereas the usefulness of mode & median are more niche.
On the other hand it is possible to fix up MOST of these queries to perform well. Mode and median are pretty much impossible to make performant on a large result set, and are actually the main reason our users have to do carefully constrained queries that don't return more than around 50k of results.
Let's assume we do a query that returns 50,000 results and the criteria is the payment_instrument_id then ideally that field will be used as the index on the query and we get the main query returned pretty quickly.
However, in order to do a median query it is necessary to order the results by total_amount. We can't use both indexes, and we can't add combined indexes for every combination of total_amount & possible criteria so we are one way or another going to be either
- using the total_amount index to sort & doing an unindexed filter - on our whole DB....
- using the index to filter & doing an unindexed sort on 50k rows
- using a merged index (these take time to compile)
Some queries are possible to rewrite - I recently got the annual query down from 6 seconds to .02 seconds but the median query just isn't every going to scale well.
Which leaves us with 'how can we help sites that with users are not happy twiddling their thumbs while the median is calculated'.
There are a few options IMHO
1) just remove median & mean - no-one (by which I mean me) cares about them anyway
2) add a setting that allows a site to specify which contribution stats they want calculated
3) only calculate median & mean if the total number of rows is < 1000
4) add a hook to permit the queries that run to be altered
Of these both 1 & 3 are imposing change on people who might not want change.
Adding a setting seems like a hack. In general adding settings to tweak core behaviour for a different use case/ preferences is almost always a hack - although the use case 'I have a big database' is perhaps a bit more generic than the 'I'd like this page/search bar / widget to behave differently & the least hassle on me is to add a setting'
I do think, however, that 4 is probably the least hacky / most sensible and it will 'gracefully retire itself' when we finally get a better search screen that doesn't use the query object.
I think it would look like
```
hookAlterQuerySummary($entity, $context, &$callbacks);
```
(only Contribution is relevant at the moment but passing entity seems to make sense)
We would have to break out the existing queries to their own fns & then we'd get
$callbacks = [
'CRM_Contact_BAO_Query::getBasicStats',
'CRM_Contact_BAO_Query::getMedian',
'CRM_Contact_BAO_Query::getMean',
'CRM_Contact_BAO_Query::getCancelStats'
]
There would then be a call like
CRM_Contact_BAO_Query::getBasicStats($rowStats, $whereClause, $fromClause)
And $rowStats would be altered by the function adding values & labels so the tpl could iterate through them
Longer term - I would argue the slow stats should probably be ADDED rather than REMOVED by extension as I think shipping something that makes hard-to-justify performance trade-offs is a big call
5.12.0
https://lab.civicrm.org/dev/core/-/issues/696
Changes to copied event phone and email reflects in original event phone and ...
2019-02-19T07:07:11Z
yashodha
Changes to copied event phone and email reflects in original event phone and email
Steps to replicate:
1. Create an event X with location A, including email A and phone A
2. Create copy of event X say Y and go to location tab for event Y (which will now show location A).
3. Click *Create new location* radio and then c...
Steps to replicate:
1. Create an event X with location A, including email A and phone A
2. Create copy of event X say Y and go to location tab for event Y (which will now show location A).
3. Click *Create new location* radio and then click new location B, including email B and phone B.
4. Check event X - email B and phone B will be listed
5.12.0
yashodha
yashodha
https://lab.civicrm.org/dev/core/-/issues/454
CiviCase access to activities permission discrepancy
2019-02-21T04:59:48Z
eileen
CiviCase access to activities permission discrepancy
I propose to alter the high level permissions for accessing case activities to always look for 'access my cases and activities' or 'access all cases and activities' (and not administer CiviCase which it inconsistently does at the moment....
I propose to alter the high level permissions for accessing case activities to always look for 'access my cases and activities' or 'access all cases and activities' (and not administer CiviCase which it inconsistently does at the moment.).
There are 2 main functions affecting CiviCase access from the various activity functions
- CRM_Case_BAO_Case::accessCiviCase - returns true if user has any one of
access my cases and activities
access all cases and activities
- CRM_Activity_BAO_Activity::checkPermission - returns true if user has any one of
access my cases and activities
access all cases and activities
administer CiviCase
In practice this means that with administer CiviCase but not the other perms I can
- access the page to configure case statuses
- not access the page to configure case types
- access the page to configure case settings
- not access the CiviCase dashboard
- access activities attached to cases through the api (or at least get past that check)
- not access activities attached to cases through contact dashboard
My take on all this is that CRM_Activity_BAO_Activity::checkPermission should only look at access my cases and activities & access all cases and activities. It seems likely the administer option was only added because it was there for other components in that bit of code.
I also think the page to configure case types should be accessible with 'administer CiviCase' but that is out of scope for this issue.
My main motivation is to address some performance issues around activity retrieval - but I need to clarify this to fix up the relevant code
https://lab.civicrm.org/dev/core/-/issues/190
custom data with multiple records profile: after submission, profile view sho...
2019-02-24T19:02:48Z
lcdweb
custom data with multiple records profile: after submission, profile view shows first record instead of most recent
To reproduce:
* create a custom data set with multiple records enabled. create a field or two.
* create a profile that includes the fields and the email field (to enable duplicate matching). make sure "update contact" is selected in the...
To reproduce:
* create a custom data set with multiple records enabled. create a field or two.
* create a profile that includes the fields and the email field (to enable duplicate matching). make sure "update contact" is selected in the advanced setting.
* open the profile in create view
* submit the form with values
* go back and submit the form a second time with different values
* notice that after submitting the second time, the profile view displays values from the first time you submitted the form, not the most recent
5.12.0
lcdweb
lcdweb
https://lab.civicrm.org/dev/core/-/issues/157
Do not delete indexes if they are needed for foreign keys
2019-02-24T21:11:32Z
Michael McAndrew
Do not delete indexes if they are needed for foreign keys
Before
------
When changing a custom field from searchable to not searchable, CiviCRM tries to remove the index. This causes a fatal error when the column is also a foreign key to another table because the index is needed for the foreig...
Before
------
When changing a custom field from searchable to not searchable, CiviCRM tries to remove the index. This causes a fatal error when the column is also a foreign key to another table because the index is needed for the foreign key.
After
-----
We ensure that the column is not an FK before removing the index
Technical details
-----------------
I added a test to CustomFieldTest which exercises this functionality
5.3.0
https://lab.civicrm.org/dev/core/-/issues/708
Advanced Search: The "Modified By" option was set instead of "Added by"
2019-03-01T20:42:46Z
Pradeep Nayak
pradpnayak@gmail.com
Advanced Search: The "Modified By" option was set instead of "Added by"
Steps:
* Click "View contact record"
* Click "Search" -> "Advanced Search"
* Open the "Change Log" tab
* Choose the "Added" radio button
* Type e.g. "test" to the search field
* Click "Search"
**Actual result:** The "Modified By" optio...
Steps:
* Click "View contact record"
* Click "Search" -> "Advanced Search"
* Open the "Change Log" tab
* Choose the "Added" radio button
* Type e.g. "test" to the search field
* Click "Search"
**Actual result:** The "Modified By" option was set instead of "Added by". Please, see screenshot
![2019-02-04_11h32_55](/uploads/f32fe780e73fdaa1a91f62964cb1568f/2019-02-04_11h32_55.png)
**Expected result:** The "Modified By" option was not set instead of "Added by".
5.12.0
https://lab.civicrm.org/dev/core/-/issues/767
Add 'Cancelled / Refunded Date' and 'Cancellation / Refund Reason' in the Det...
2019-03-04T13:47:10Z
Ghost User
Add 'Cancelled / Refunded Date' and 'Cancellation / Refund Reason' in the Detail Contributions Report
Add the fields and filters 'Cancelled / Refunded Date' and 'Cancellation / Refund Reason' in the Detail Contributions Report.
Add the fields and filters 'Cancelled / Refunded Date' and 'Cancellation / Refund Reason' in the Detail Contributions Report.
yashodha
yashodha
https://lab.civicrm.org/dev/core/-/issues/41
Search Builder: Not empty with date or integer custom fields gives a sql warning
2019-03-07T19:25:44Z
samuelsov
Search Builder: Not empty with date or integer custom fields gives a sql warning
Mentioned by @bgm for a contact reference in mattermost https://chat.civicrm.org/civicrm/pl/49hcecoy5bb9mmsnrfzuzt9a4y and reproduced with a date custom field.
To reproduce :
* create a contactReference custom field or a date custom ...
Mentioned by @bgm for a contact reference in mattermost https://chat.civicrm.org/civicrm/pl/49hcecoy5bb9mmsnrfzuzt9a4y and reproduced with a date custom field.
To reproduce :
* create a contactReference custom field or a date custom field
* populate some data on a few records
* use the Search Builder to search on that field, with condition "where [field] is not empty"
Here is an example of query that Mysql doesn't like :
```sql
CREATE TEMPORARY TABLE civicrm_temp_group_contact_cache1062 (SELECT 16 as group_id, contact_a.id as id FROM civicrm_contact contact_a
LEFT JOIN civicrm_value_cfa_contact_2 ON civicrm_value_cfa_contact_2.entity_id = `contact_a`.id WHERE ( ( contact_a.contact_type = "individual" AND (NULLIF(civicrm_value_cfa_contact_2.date_de_validation_manuelle_23, '') IS NOT NULL) ) ) AND (contact_a.is_deleted = 0) AND contact_a.id NOT IN (
SELECT contact_id FROM civicrm_group_contact
WHERE civicrm_group_contact.status = "Removed"
AND civicrm_group_contact.group_id = 16 ) );
```
The warning is :
```sql
SHOW warnings;
+---------+------+------------------------------+
| Level | Code | Message |
+---------+------+------------------------------+
| Warning | 1292 | Incorrect datetime value: '' |
+---------+------+------------------------------+
1 row in set (0.00 sec)
```
5.4.0
Monish Deb
Monish Deb