Development issueshttps://lab.civicrm.org/groups/dev/-/issues2019-12-05T04:47:50Zhttps://lab.civicrm.org/dev/core/-/issues/1426Manager/Creator Information not being returned for case related contacts when...2019-12-05T04:47:50Ztunbola@compucorp.co.ukManager/Creator Information not being returned for case related contacts when fetching Case DetailsOverview
----------------------------------------
When Fetching a case details e.g by calling the Case.get API, related contacts are returned with extra information returned for
creators and managers (see: https://github.com/civicrm/civ...Overview
----------------------------------------
When Fetching a case details e.g by calling the Case.get API, related contacts are returned with extra information returned for
creators and managers (see: https://github.com/civicrm/civicrm-core/blob/master/CRM/Case/BAO/Case.php#L1198)
e.g
```php
{
"contacts": [
{
"contact_id": "2",
"display_name": "Tetss ssss",
"sort_name": "ssss, Tetss",
"relationship_type_id": "11",
"role": "Case Coordinator is",
"email": "admin@example.com",
"phone": "",
"manager": "1" //Manager details added here. Part of extra information for case related contacts
}
]
}
```
## Issue
When saving sase soles for a case type, It is the reverse relationship type that gets saved for the case type. e.g if the case role label`_b_a` is displayed as the option label relationship type when
adding a case role to a case type, when this gets saved, it is actually the name`_a_b` that get saved in the database for that relationship type
![Housing_Support__CiviCase_2019-11-27_18-02-55](/uploads/5997bf68db91a67c4c655898bf63d751/Housing_Support__CiviCase_2019-11-27_18-02-55.png)
Please see the code that generates the relationship type options used for this screen here: https://github.com/civicrm/civicrm-core/blob/master/ang/crmCaseType.js#L335-L338
Not sure why the order is reversed as this seems [intentional](https://github.com/civicrm/civicrm-core/blob/master/ang/crmCaseType.js#L328). However this has some **implications:**
When calling the Case.get API, it returns related contacts along with the API results. It should also add the details or more info about the role (creator, manager) for applicable contacts also, so that for contacts that has a manager role, the `manager => 1` is returned along with the contact information, this helps identify the manager quickly. https://github.com/civicrm/civicrm-core/blob/master/api/v3/Case.php#L626
However this line here (https://github.com/civicrm/civicrm-core/blob/master/CRM/Case/BAO/Case.php#L1199) returns a NULL even when there is a valid case
manager for the case and as such the extra information is not added. The reason is that the `$CaseRoles` array here(https://github.com/civicrm/civicrm-core/blob/master/CRM/Case/BAO/Case.php#L1138) fetches the case roles stored in the case type definition which is fine but the results of the query returns the role name that does not match what is stored for the case role.
Reproduction steps
----------------------------------------
For example for the default relationship type that ships with civicrm
Name AB = Case Coordinator is
Label AB = Case Coordinator is
Name BA = Case Coordinator
Label BA = Case Coordinator
If I add this relationship type as a case role and as manager i.e as `Case Coordinator is` (Name AB) for a case type, it is the (Case Coordinator) that gets saved in the definition column in case_type table. If I then assign a contact as the (Case Coordinator is) for a contact (client) then create a new case with this contact as the case client.
Current behaviour
----------------------------------------
When I try to get the Case Details for this case, when this query is ran https://github.com/civicrm/civicrm-core/blob/master/CRM/Case/BAO/Case.php#L1142-L1176, it returns the `Case Coordinator is` as the role name for the related contact which is fine but this line
https://github.com/civicrm/civicrm-core/blob/master/CRM/Case/BAO/Case.php#L1199 returns NULL because what is saved in the case definition is the reverse relationship name i.e (`Case Coordinator`) hence, the extra details is not added for the contact.
```php
{
"contacts": [
{
"contact_id": "2",
"display_name": "Tetss ssss",
"sort_name": "ssss, Tetss",
"relationship_type_id": "11",
"role": "Case Coordinator is",
"email": "admin@example.com",
"phone": "",
}
]
}
```
In previous versions of Civicrm e.g `5.15`, the relationship type options were not swapped and this functionality worked fine, see https://github.com/civicrm/civicrm-core/blob/5.15/ang/crmCaseType.js#L266-L295
Expected behaviour
----------------------------------------
When I try to get the Case Details for this case, the extra details such as `manager => 1` should be added for the Contact who is the Case Coordinator for the Client.
```php
{
"contacts": [
{
"contact_id": "2",
"display_name": "Tetss ssss",
"sort_name": "ssss, Tetss",
"relationship_type_id": "11",
"role": "Case Coordinator is",
"email": "admin@example.com",
"phone": "",
"manager": "1" //Manager details added here
}
]
}
```5.21.0https://lab.civicrm.org/dev/core/-/issues/1425CIVI-SA-2019-21 may lead to regressions when following typehints on CRM_Core_...2019-12-11T19:47:08ZjensschuppeCIVI-SA-2019-21 may lead to regressions when following typehints on CRM_Core_BAO_Setting::setItem()The last security upgrade 5.19.3 introduced a replacement for `unserialize()` which does not allow PHP objects anymore.
This led to serious problems in some of our extensions that make use of `CRM_Core_BAO_Setting::setItem()` for storin...The last security upgrade 5.19.3 introduced a replacement for `unserialize()` which does not allow PHP objects anymore.
This led to serious problems in some of our extensions that make use of `CRM_Core_BAO_Setting::setItem()` for storing extension settings. Since this method explicitly expects settings values to be of type `object`, those settings can not be retrieved from the database anymore.
All those extensions need an upgrader that converts objects in settings records to arrays. Unfortunately, some of those extensions, whenever the current settings are being fetched and there are no defaults, stores those defaults to the database (alongside existing settings, which are now not fetched anymore), which resulted in data loss.
Of course, that's the responsibility of the extension, but `CRM_Core_BAO_Setting::setItem()`'s typehinting is now wrong and should be reworked.5.22.0https://lab.civicrm.org/dev/core/-/issues/1424Export doesn't work in Excel with diacritic chars2020-07-12T03:19:04ZeileenExport doesn't work in Excel with diacritic charsPROPOSAL - prepend the BOM for UTF8 "\xEF\xBB\xBF" so csv's exported from excel
Discussion (note this is the same writeup on the PR - creating a gitlab too as I suspect there might be discussion).
There is a long-standing issue ...PROPOSAL - prepend the BOM for UTF8 "\xEF\xBB\xBF" so csv's exported from excel
Discussion (note this is the same writeup on the PR - creating a gitlab too as I suspect there might be discussion).
There is a long-standing issue whereby files exported from CiviCRM with diacritic characters - eg.
ę are mangled when opened in MS Excel.
The underlying issue is that the characters are UTF-8 encoded & MS Excel by default does not assume UTF8.
In order to do so it needs a BOM - Byte Order Marker - which is a few hex characters at the start of
the csv.
The BOM indicator is 'not recommended' .... unless you want your csv to work with
MS Excel. Since MS Excel is a major use case for csvs I think it's pretty clear that all
things being equal we want to support it... I note that there are extensions to export to excel
natively but I don't think that replaces this. The number one reason to want to export
a csv is to work with it in a spreadsheeting programme & unless we can't safely make it
work in core we shouldn't require an extension for that.
There are various recommendations over time but it seems things have improved in the MS
Excel world and what works on Windows now appears to work on Mac too - at least on a recent version.
This link https://donatstudios.com/CSV-An-Encoding-Nightmare is a pretty good discussion.
While the above link and others say that you need a different BOM for MAC than Windows my
testing shows that the one recommended for Windows works fine on Mac Excel (while you would need
to convert to UTF 16 to follow the Mac recommendation. (https://csv.thephpleague.com/9.0/interoperability/encoding/)
Other links
https://stackoverflow.com/questions/35294443/does-excel-for-mac-2016-properly-import-unicode-in-csv-files
https://stackoverflow.com/questions/2223882/whats-the-difference-between-utf-8-and-utf-8-without-bom/2223926#2223926
Notably this summary :
" When should you encode with a BOM?
If you're unable to record the metadata in any other way (through a charset tag or file system meta), and the programs being used like BOMs, you should encode with a BOM. This is especially true on Windows where anything without a BOM is generally assumed to be using a legacy code page. The BOM tells programs like Office that, yes, the text in this file is Unicode; here's the encoding used.
When it comes down to it, the only files I ever really have problems with are CSV. Depending on the program, it either must, or must not have a BOM. For example, if you're using Excel 2007+ on Windows, it must be encoded with a BOM if you want to open it smoothly and not have to resort to importing the data."
So the argument for a BOM is - if you want it to be compatible with MS Excel use a BOM. This seems to apply.
The risk is that perhaps there is some variant of csv viewing programme that can't cope - the risk of this is rather mitigited by
1) the fact that MS Excel adds the BOM to the start of any files it saves as UTF-8 encoded csv so any programme that expects to open MS Excel generated
csvs would need to be able to cope with it. In addition it is a standard, if not required, file indicator so it feels like the programmes
that were legacy in 2016 writeups might be of no concern now.
2) There really is no programatic way to export these csvs so the risk that this is being parsed by code is close to zero
There are 2 other things we could do to mitigate
1) test on more platforms - I've tested with MS Excel for Mac (Office 365 v 16.31) and Libre Office and MS Numbers
& MS word, cot editor & notes
2) We could add a setting. I'm generally a bit loath on settings as they are a bit of a maintenance nightmare.
However, perhaps it would be a setting like 'export csvs in legacy format & there could be a link
to the gitlab to explain your use-case if you feel the need to set it. If no-one does then we could later remove.
Final note - csv tables are created with the CRM_Core_Report_Excel (spot the irony) from 3 places
- the main export, the export for custom fields & a third place which I believe to be unreachable. This is one path
only but I can look at centralising for the custom fields export path.5.22.0https://lab.civicrm.org/dev/financial/-/issues/109Invoice does not assign/display the contact's country2020-03-01T20:27:10ZbgmInvoice does not assign/display the contact's countryTo reproduce:
* Enable Taxes and Invoicing
* Edit the "Contribution Invoice Receipt" message template to include `{$country}` (other related contact tokens are called `{$street_address}`, `{$email}`, etc.
* Go to a contact, create a con...To reproduce:
* Enable Taxes and Invoicing
* Edit the "Contribution Invoice Receipt" message template to include `{$country}` (other related contact tokens are called `{$street_address}`, `{$email}`, etc.
* Go to a contact, create a contribution, and from "view contribution", click "print PDF invoice" to view an invoice.
The country will be empty.5.24.0https://lab.civicrm.org/dev/core/-/issues/1422Event Participants actions (Print Name Badges, Export...) ignores search crit...2019-12-09T01:47:09ZalainbEvent Participants actions (Print Name Badges, Export...) ignores search criteriaOverview
----------------------------------------
After a participant search from an event, the actions ignore the search criteria.
Reproduction steps
----------------------------------------
In the CiviCRM demo environment:
1. Click on...Overview
----------------------------------------
After a participant search from an event, the actions ignore the search criteria.
Reproduction steps
----------------------------------------
In the CiviCRM demo environment:
1. Click on **Events -> Manage Events**.
1. For e.g. the Rain-forest Cup Youth Soccer Tournament, click on the right-hand side, click on **Participants -> Registered, Attended, Pending...**.
1. Got 8 participants.
1. Click on **All 8 records -> Actions -> Name Badges Print**
1. The next screen shows **Number of selected participants: 18** instead of **8**.
Similar problem if you select the export action: the confirmation screen shows 8, but the actual export contains 18 lines.
Comments
----------------------------------------
I noticed that the function setDefaults() was removed from the file CRM/Event/Form/Search.php
between these changes:
* still there: https://lab.civicrm.org/dev/core/blob/8a6fde27c69f5e6e51fa91060fa67124d9ca9e18/CRM/Event/Form/Search.php
* removed: https://lab.civicrm.org/dev/core/blob/6fbf3a31a162dd5bdaff0db876360bc4e0f09a49/CRM/Event/Form/Search.php
when I add the function setDefaults() again in CRM/Event/Form/Search.php, the problem seems to be solved.
Can anyone confirm this?5.19.4https://lab.civicrm.org/dev/core/-/issues/1421Fix export merge for contacts with shared addresses2023-01-12T05:03:20ZeileenFix export merge for contacts with shared addressesCurrently when you export contacts with the same address contacts who have the same street address, city, state are merged, but all the handling for those who are linked by civicrm_address.master_id is bypassed.
I'm pretty sure this bro...Currently when you export contacts with the same address contacts who have the same street address, city, state are merged, but all the handling for those who are linked by civicrm_address.master_id is bypassed.
I'm pretty sure this broke quite a long time ago. However, it was only picked up by @monish.deb in the course of addressing another issue. I believe that it has gone largely unnoticed because generally the code enforces that the setting of master_id updates the address to match - causing them to still be exported on that basis.
However, the handling of display name differs between the by-passed-shared-via-master-id & shared-via-sameness.
| Contact 1 | Contact 2 |Contact 3 |Result with shared via sameness|~~Result with shared via master_id~~|'feels right'|
| --------- | ---------- |---------- |------------------------------ |------------------------------- |-------------|
| Bob | Sarah | Jill | Dear Bob, Sarah, Jill |Dear Bob, |Dear Bob, Sarah, Jill|
| Big Business Limited | Sarah | Jill | Dear Big Business Limited , Sarah, Jill |Dear Big Business Limited , |Dear Big Business Limited |
| Big Business Limited | Sarah | Jill (not shared via master_id) | Dear Big Business Limited , Sarah, Jill |Dear Big Business Limited , Jill (TBC) |Dear Big Business Limited, Jill |
| Bob's household | Sarah | Jill | Dear Bob's household, Sarah, Jill |Dear Bob's household, |Dear Bob's household |
| Bob's household | Sarah | Jill (not a household member OR shared via master id) | Dear Bob's household, Sarah, Jill |Dear Bob's household, |Dear Bob's household, Jill |
As can be seen 'fixing' this bug will feel like a regression where addresses are shared between individuals. I think the handling needs to be that the name of the shared address owner is used only if that contact is NOT an individual. If there is a shared address owner and that owner contact type is NOT an individual the address owner's detail is used. Otherwise the contact sharing the address's name is appended.https://lab.civicrm.org/dev/core/-/issues/1420Quicksearch with phone filter doesn't work with non-numeric character2020-01-10T07:23:49ZMonish DebQuicksearch with phone filter doesn't work with non-numeric characterSteps to replicate:
1. Say a contact A has a phone number : 876-123-234
2. Go to quicksearch bar and select 'Phone' filter
3. Type '876-123' in the search field.
Bug: It doesn't return contact A, because the code doesn't trim non-numeri...Steps to replicate:
1. Say a contact A has a phone number : 876-123-234
2. Go to quicksearch bar and select 'Phone' filter
3. Type '876-123' in the search field.
Bug: It doesn't return contact A, because the code doesn't trim non-numeric character for the phone_numeric filter which expects only numeric digits.5.21.0Monish DebMonish Debhttps://lab.civicrm.org/dev/drupal/-/issues/96Add user format to CiviCRM Entity2021-02-04T19:28:45ZedvanleeuwenAdd user format to CiviCRM EntityFeature request: I would like to have the following user format added to CiviCRM Entity.
In civicrm_entity.module, function _civicrm_entity_options_username_format:
` 'nick.middle.last' => t('Nick.Middle.Last'),
'nick.middlelast'...Feature request: I would like to have the following user format added to CiviCRM Entity.
In civicrm_entity.module, function _civicrm_entity_options_username_format:
` 'nick.middle.last' => t('Nick.Middle.Last'),
'nick.middlelast' => t('Nick.MiddleLast'),`
[civicrm_entity.module](/uploads/bd29a74959e50bc5fc2411891d0a94e9/civicrm_entity.module)
In civicrm_entity.module, function civicrm_entity_action_create_user:
```
case 'nick.middle.last':
if (!empty($contact['middle_name'])) {
$params['name'] = _civicrm_entity_clean_login_name(trim($contact['nick_name']) . "." . trim($contact['middle_name']) . "." . trim($contact['last_name']));
} else {
$params['name'] = _civicrm_entity_clean_login_name(trim($contact['nick_name']) . "." . trim($contact['last_name']));
}
break;
case 'nick.middlelast':
if (!empty($contact['middle_name'])) {
$params['name'] = _civicrm_entity_clean_login_name(trim($contact['nick_name']) . "." . trim($contact['middle_name']) . trim($contact['last_name']));
} else {
$params['name'] = _civicrm_entity_clean_login_name(trim($contact['nick_name']) . "." . trim($contact['last_name']));
}
break;
```
An adapted file has been attached.https://lab.civicrm.org/dev/core/-/issues/1418CiviEvent Registration Page Redirect takes over WP Content2019-11-27T16:54:46ZCoreyBurgerCiviEvent Registration Page Redirect takes over WP ContentI am reopening an old JIRA bug: https://issues.civicrm.org/jira/browse/CRM-17288 because it isn't solved for me. Wordpress 5.3 with CiviCRM 5.19.2.
Steps to reproduce:
1. Be logged in
2. Register for an event
3. Go to main page
4. Get...I am reopening an old JIRA bug: https://issues.civicrm.org/jira/browse/CRM-17288 because it isn't solved for me. Wordpress 5.3 with CiviCRM 5.19.2.
Steps to reproduce:
1. Be logged in
2. Register for an event
3. Go to main page
4. Get automatically redirected to last registered eventhttps://lab.civicrm.org/dev/core/-/issues/1417Default view on Constituent details wastes space with unneeded headers2023-01-11T05:03:27ZCoreyBurgerDefault view on Constituent details wastes space with unneeded headersThe default Constituent Detail report wastes huge amounts of space on pages, while the Constitient Summary report, which is nicely organized, lacks key details like membership.
My use case is as follows: I want to print off the high lev...The default Constituent Detail report wastes huge amounts of space on pages, while the Constitient Summary report, which is nicely organized, lacks key details like membership.
My use case is as follows: I want to print off the high level details for a committee meeting. My contacts are organized into a group. What I want to be able to view for that meeting is the following: Name, Email, Address and Membership Status.
There are three reports I could use for this:
1. Constituent Summary - no membership
2. Constituent Details - wasted space
3. Membership Summary - misses all non-members
The simplest solution to this problem is to edit the Constituient Details template to remove unneeded headers. I'm happy to help make this change, but I honestly have no idea where in the code I would find the needed templates to edithttps://lab.civicrm.org/dev/core/-/issues/1415No easy way to see campaign activities2023-01-10T05:03:25ZCoreyBurgerNo easy way to see campaign activitiesOn the campaign dashboard, there is no way to see data related to that campaign. Ideally, there should be a View Activities link that is a search that lists all activities associated with that campaign.
As a secondary goal, this should...On the campaign dashboard, there is no way to see data related to that campaign. Ideally, there should be a View Activities link that is a search that lists all activities associated with that campaign.
As a secondary goal, this should be expanded to be a "dashboard" showing goals: revenue, membership, etc. along with a list of latest activities below that.https://lab.civicrm.org/dev/drupal/-/issues/95Participant is_test field was missing from drupal views2019-11-22T23:37:05Zmagnolia61Participant is_test field was missing from drupal viewsThe Participant is_test field was missing from drupal views
I used the same approach as the membership is_test field to add it.
https://github.com/civicrm/civicrm-drupal/pull/590The Participant is_test field was missing from drupal views
I used the same approach as the membership is_test field to add it.
https://github.com/civicrm/civicrm-drupal/pull/5905.21.0magnolia61magnolia61https://lab.civicrm.org/dev/core/-/issues/1414Url search with `civicrm/case/search?case_owner=2&force=1` gives an E_NOTICE2019-11-22T02:47:10ZDaveDUrl search with `civicrm/case/search?case_owner=2&force=1` gives an E_NOTICEThis just started in master recently and I can't reproduce in 5.20 but I can on the public demo which is 5.21alpha1.
Running a url search `civicrm/case/search?reset=1&case_owner=2&force=1` gives
`Notice: Undefined index: html in CRM_Co...This just started in master recently and I can't reproduce in 5.20 but I can on the public demo which is 5.21alpha1.
Running a url search `civicrm/case/search?reset=1&case_owner=2&force=1` gives
`Notice: Undefined index: html in CRM_Core_Form_Search->getEntityDefaults() (line 291 of ...\CRM\Core\Form\Search.php)`
ping @seamuslee5.21.0seamusleeseamusleehttps://lab.civicrm.org/dev/core/-/issues/1412CiviMail sent via wp-cli and cron mangles mailing urls on WP2019-11-26T20:23:49ZkcristianoCiviMail sent via wp-cli and cron mangles mailing urls on WPStarting in 5.19 we have an issue with URLs in CiviMail. If Track links is on the URLs get mangled. Dradt Emails are fine, as well as if you kick off the scheduled job manually (UI or CLI).
However, if cron runs the job the URLS are b...Starting in 5.19 we have an issue with URLs in CiviMail. If Track links is on the URLs get mangled. Dradt Emails are fine, as well as if you kick off the scheduled job manually (UI or CLI).
However, if cron runs the job the URLS are broken:
Mailing Urls expected:
https://example.org//wp-content/plugins/civicrm/civicrm/extern/url.php?u=19&qid=31
But we get:
https://example.org/home/example/public_html/wp-content/plugins/civicrm/civicrm/extern/url.php?u=19&qid=31
Tested Enviornments:
CiviCRM 5.19.x
WP: 5.3
wp-cli : 2.3 or 2.4
php 7.1 or 7.2 or 7.3
Cron run via script:
```sh
#!/bin/bash
/usr/local/bin/wp --user=civicron --url=https://example.org --path=/home/example/public_html --timezone="America/New_York" civicrm api job.execute auth=0
```
On Single site we can work around using `cv` or `cli.php` That fails on Multi-Domain
```sh
#/usr/local/bin/php /usr/local/bin/cv api job.execute --user=civicron --cwd=/home/example/public_html
```
Multi-Site Example:
WP MS 5.3
CiviCRM 5.19.1
php 7.1 (also tested 7.2)
wp-cli 2.4 (also tested 2.3)
cli.php results
```
you need to configure site : PHP Fatal error: Uncaught RuntimeException: Undefined constant: CIVICRM_UF_BASEURL in /home/members/example/sites/example.org/web/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress
.php:105
```
cv results
```
you need to configure site : PHP Fatal error: Uncaught RuntimeException: Undefined constant: CIVICRM_UF_BASEURL in /home/members/example/sites/example.org/web/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/WordPress
.php:105
```
script:
```sh
#!/bin/bash
#/usr/bin/php /home/members/example/sites/example.org/users/example/bin/cv api job.execute --user=civicron --cwd=/home/members/example/sites/example.org/users/example/web
#/usr/bin/php /home/members/example/sites/example.org/users/example/web/wp-content/plugins/civicrm/civicrm/bin/cli.php -s https://example-la.org -u civicron -p "civicrm" -e Job -a execute
#/usr/bin/php /home/members/example/sites/example.org/users/example/web/wp-content/plugins/civicrm/civicrm/bin/cli.php -s https://www.example.org -u civicron -p "civicrm" -e Job -a execute
/home/members/example/sites/example.org/users/example/bin/wp --user=tadpole --url=https://www.example.org --timezone="America/New_York" civicrm api job.execute auth=0
/home/members/example/sites/example.org/users/example/bin/wp --user=tadpole --url=https://another-example.org --timezone="America/New_York" civicrm api job.execute auth=0
```
We can fix the mangled URLS with a Work Around via .htaccess
```
#email redirect
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example-la\.org$ [NC]
RewriteRule ^home\/members\/example\/sites\/example.org\/web\/(.*)$ "https\:\/\/example-la\.org\/$1" [R=301,L,QSA]
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.example\.org$ [NC]
RewriteRule ^home\/members\/example\/sites\/example.org\/web\/(.*)$ "https\:\/\/www\.example\.org\/$1" [R=301,L,QSA]
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.org$ [NC]
RewriteRule ^home\/members\/example\/sites\/example.org\/web\/(.*)$ "https\:\/\/example\.org\/$1" [R=301,L,QSA]
```
Reviewed with @haystack and @andrei Chritian came up with this Patch that I added to our local repo: https://github.com/tadpolecc/civicrm/commit/9470e1fb51ef317ee6d3f211af1bbf99e91431db
PR will be coming as this is a regression5.19.3https://lab.civicrm.org/dev/core/-/issues/1411Can't search for activity subjects starting with 1 - and many more caching is...2019-12-02T18:54:32ZJonGoldCan't search for activity subjects starting with 1 - and many more caching issuesOverview
----------------------------------------
Due to how the query that fills the SQL cache is built, it fails under some very common circumstances. Some of those are hidden by the fact that Civi will fall back to an uncached search...Overview
----------------------------------------
Due to how the query that fills the SQL cache is built, it fails under some very common circumstances. Some of those are hidden by the fact that Civi will fall back to an uncached search; some simply show no results.
Reproduction steps
----------------------------------------
1. Create a new activity with a subject of `12345`.
1. On **Advanced Search**, search **Activity Text** for `12345`.
1. Observe no results found.
1. Search **Activity Text** for `2345`.
1. Observe the the activity is found.
Why this happens
----------------------------------------
* The SQL created is something like `SELECT contact_a.id FROM civicrm_activity WHERE activity_subject like '%12345%'`.
* `CRM_Contact_Selector` has [this code snippet](https://github.com/civicrm/civicrm-core/blob/cf70a3eee02b1f46b23435b882d261fd400713b0/CRM/Contact/Selector.php#L1042-L1046) which replaces `SELECT contact_a.id` with `"SELECT DISTINCT %1, contact_a.id, contact_a.sort_name"`, which yields `SELECT DISTINCT %1, contact_a.id, contact_a.sort_name FROM civicrm_activity WHERE activity_subject like '%12345%'`.
* It then passes this SQL to a function that does variable substitution - but the `%1` in `%12345%` gets substituted with the cache key!
This problem manifests with any Advanced Search field that prepends a wildcard (`%`) to the form value. However, if you search for a contact named `12345` the search will still complete, because there's a fallback query in case of exceptions.
Additional Note(s)
----------------------------------------
I'm going to break my PR into two parts to make it easier to review. The first part will deal with the bug itself; I'll follow up with a cleanup PR to simplily the `fillWithSQL` signature.
The `fillWithSQL` method is only called in [one other place in the code](https://github.com/civicrm/civicrm-core/blob/1cf214fd05844767bb1b9587cca796ac47102042/CRM/Campaign/Selector/Search.php#L268-L274), in CiviCampaign. However, this query ALWAYS fails, because it puts `FROM` twice in a row. So this will always fail to populate the cache.5.21.0JonGoldJonGoldhttps://lab.civicrm.org/dev/core/-/issues/1410civicrm/case/search?reset=1&force=1&case_subject=test gives php warning2019-11-22T01:47:09ZDaveDcivicrm/case/search?reset=1&force=1&case_subject=test gives php warningI know there's still ongoing work related to force=1 in urls for search, but reporting that `civicrm/case/search?reset=1&force=1&case_subject=test` gives `Warning: htmlspecialchars() expects parameter 1 to be string, array given in HTML_...I know there's still ongoing work related to force=1 in urls for search, but reporting that `civicrm/case/search?reset=1&force=1&case_subject=test` gives `Warning: htmlspecialchars() expects parameter 1 to be string, array given in HTML_Common->_getAttrString()`
The results seem correct, there's just the php warning.5.21.0seamusleeseamusleehttps://lab.civicrm.org/dev/drupal/-/issues/94Notice: Undefined property: CRM_Core_DAO2024-03-13T19:07:26ZGhost UserNotice: Undefined property: CRM_Core_DAOAfter a login in drupal I see the following errors:
* Notice: Undefined property: CRM_Core_DAO::$Private_Adresse-street_address in CRM_Core_BAO_UFGroup::getValues() (Zeile 1289 von /var/www/html/sites/all/modules/civicrm/CRM/Core/BAO/UF...After a login in drupal I see the following errors:
* Notice: Undefined property: CRM_Core_DAO::$Private_Adresse-street_address in CRM_Core_BAO_UFGroup::getValues() (Zeile 1289 von /var/www/html/sites/all/modules/civicrm/CRM/Core/BAO/UFGroup.php).
* Notice: Undefined property: CRM_Core_DAO::$Private_Adresse-city in CRM_Core_BAO_UFGroup::getValues() (Zeile 1289 von /var/www/html/sites/all/modules/civicrm/CRM/Core/BAO/UFGroup.php).
* Notice: Undefined property: CRM_Core_DAO::$Private_Adresse-postal_code in CRM_Core_BAO_UFGroup::getValues() (Zeile 1289 von /var/www/html/sites/all/modules/civicrm/CRM/Core/BAO/UFGroup.php).
* Notice: Undefined property: CRM_Core_DAO::$Private_Adresse-country in CRM_Core_BAO_UFGroup::getValues() (Zeile 1264 von /var/www/html/sites/all/modules/civicrm/CRM/Core/BAO/UFGroup.php).
* Notice: Undefined property: CRM_Core_DAO::$Private_Adresse-country_id in CRM_Core_BAO_UFGroup::getValues() (Zeile 1266 von /var/www/html/sites/all/modules/civicrm/CRM/Core/BAO/UFGroup.php).
* Notice: Undefined property: CRM_Core_DAO::$Private_Adresse-state_province in CRM_Core_BAO_UFGroup::getValues() (Zeile 1264 von /var/www/html/sites/all/modules/civicrm/CRM/Core/BAO/UFGroup.php).
* Notice: Undefined property: CRM_Core_DAO::$Private_Adresse-state_province_id in CRM_Core_BAO_UFGroup::getValues() (Zeile 1266 von /var/www/html/sites/all/modules/civicrm/CRM/Core/BAO/UFGroup.php).
![image](/uploads/02599db50123540bbe5d48006cd818a6/image.png)
---
CiviCRM Version: `7.x-5.18.4`
Drupal Version: `7.67`https://lab.civicrm.org/dev/core/-/issues/1407CiviContribute Confirm Text2023-02-21T05:04:08ZanilpremlallCiviContribute Confirm TextOverview
----------------------------------------
Minor text change for clarity. Replace Continue with Make Contribution
Example use-case
----------------------------------------
1. Enable "Use a confirmation page?" option on Contributi...Overview
----------------------------------------
Minor text change for clarity. Replace Continue with Make Contribution
Example use-case
----------------------------------------
1. Enable "Use a confirmation page?" option on Contribution Page
2. Launch a test-drive contribution
3. Enter required fields and click "Confirm Contribution"
4. Help text in reference is at the top of the confirmation page
Current behaviour
----------------------------------------
Text: Please verify the information below carefully. Click **Go Back** if you need to make changes. To complete your contribution, click the **Continue** button below.
Proposed behaviour
----------------------------------------
Text: Please verify the information below carefully. Click **Go Back** if you need to make changes. To complete your contribution, click the **Make Contribution** button below.
Comments
----------------------------------------
Thank you for looking into this![CiviContribute-Text](/uploads/350d742bc23b81bc337b0c07cdb63434/CiviContribute-Text.png)https://lab.civicrm.org/dev/core/-/issues/1406Cannot filter by 'Member Since' in Membership Summary Report2019-11-20T21:46:44Zm robimorgan@palantetech.coopCannot filter by 'Member Since' in Membership Summary Report
When selecting any date range as a filter in the Membership Summary Report, I get the below error. Have replicated here:
https://dmaster.demo.civicrm.org/civicrm/report/member/summary
This may be a quick fix, but I am creating this is...
When selecting any date range as a filter in the Membership Summary Report, I get the below error. Have replicated here:
https://dmaster.demo.civicrm.org/civicrm/report/member/summary
This may be a quick fix, but I am creating this issue as I don't have time to dig into it now.
```
Nov 18 12:10:26 [error] $Fatal Error Details = Array
(
[callback] => Array
(
[0] => CRM_Core_Error
[1] => handle
)
[code] => -19
[message] => DB Error: no such field
[mode] => 16
[debug_info] => SELECT SQL_CALC_FOUND_ROWS COUNT( DISTINCT membership_civireport.id ) as civicrm_membership_member_count, membership_civireport.membership_type_id as civicrm_membership_membership_type_id, contribution_civireport.currency as civicrm_contribution_currency, IFNULL(SUM(contribution_civireport.total_amount), 0) as civicrm_contribution_total_amount_sum, COUNT(contribution_civireport.total_amount) as civicrm_contribution_total_amount_count, IFNULL(ROUND(AVG(contribution_civireport.total_amount),2), 0) as civicrm_contribution_total_amount_avg
FROM civicrm_membership membership_civireport
LEFT JOIN civicrm_contact contact_civireport ON ( membership_civireport.contact_id = contact_civireport.id )
LEFT JOIN civicrm_membership_status
ON (membership_civireport.status_id = civicrm_membership_status.id )
LEFT JOIN civicrm_membership_payment payment
ON ( membership_civireport.id = payment.membership_id )
LEFT JOIN civicrm_contribution contribution_civireport
ON payment.contribution_id = contribution_civireport.id WHERE membership_civireport.is_test = 0 AND
contact_civireport.is_deleted = 0 AND ( membership_civireport.membership_join_date >= 20191118000000 ) AND ( membership_civireport.membership_join_date <= 20191118235959 ) GROUP BY membership_civireport.membership_type_id WITH ROLLUP LIMIT 0, 50 [nativecode=1054 ** Unknown column 'membership_civireport.membership_join_date' in 'where clause']
[type] => DB_Error
[user_info] => SELECT SQL_CALC_FOUND_ROWS COUNT( DISTINCT membership_civireport.id ) as civicrm_membership_member_count, membership_civireport.membership_type_id as civicrm_membership_membership_type_id, contribution_civireport.currency as civicrm_contribution_currency, IFNULL(SUM(contribution_civireport.total_amount), 0) as civicrm_contribution_total_amount_sum, COUNT(contribution_civireport.total_amount) as civicrm_contribution_total_amount_count, IFNULL(ROUND(AVG(contribution_civireport.total_amount),2), 0) as civicrm_contribution_total_amount_avg
FROM civicrm_membership membership_civireport
LEFT JOIN civicrm_contact contact_civireport ON ( membership_civireport.contact_id = contact_civireport.id )
LEFT JOIN civicrm_membership_status
ON (membership_civireport.status_id = civicrm_membership_status.id )
LEFT JOIN civicrm_membership_payment payment
ON ( membership_civireport.id = payment.membership_id )
LEFT JOIN civicrm_contribution contribution_civireport
ON payment.contribution_id = contribution_civireport.id WHERE membership_civireport.is_test = 0 AND
contact_civireport.is_deleted = 0 AND ( membership_civireport.membership_join_date >= 20191118000000 ) AND ( membership_civireport.membership_join_date <= 20191118235959 ) GROUP BY membership_civireport.membership_type_id WITH ROLLUP LIMIT 0, 50 [nativecode=1054 ** Unknown column 'membership_civireport.membership_join_date' in 'where clause']
[to_string] => [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT SQL_CALC_FOUND_ROWS COUNT( DISTINCT membership_civireport.id ) as civicrm_membership_member_count, membership_civireport.membership_type_id as civicrm_membership_membership_type_id, contribution_civireport.currency as civicrm_contribution_currency, IFNULL(SUM(contribution_civireport.total_amount), 0) as civicrm_contribution_total_amount_sum, COUNT(contribution_civireport.total_amount) as civicrm_contribution_total_amount_count, IFNULL(ROUND(AVG(contribution_civireport.total_amount),2), 0) as civicrm_contribution_total_amount_avg
FROM civicrm_membership membership_civireport
LEFT JOIN civicrm_contact contact_civireport ON ( membership_civireport.contact_id = contact_civireport.id )
LEFT JOIN civicrm_membership_status
ON (membership_civireport.status_id = civicrm_membership_status.id )
LEFT JOIN civicrm_membership_payment payment
ON ( membership_civireport.id = payment.membership_id )
LEFT JOIN civicrm_contribution contribution_civireport
ON payment.contribution_id = contribution_civireport.id WHERE membership_civireport.is_test = 0 AND
contact_civireport.is_deleted = 0 AND ( membership_civireport.membership_join_date >= 20191118000000 ) AND ( membership_civireport.membership_join_date <= 20191118235959 ) GROUP BY membership_civireport.membership_type_id WITH ROLLUP LIMIT 0, 50 [nativecode=1054 ** Unknown column 'membership_civireport.membership_join_date' in 'where clause']"]
)
```5.19.2https://lab.civicrm.org/dev/core/-/issues/1405CiviCRM Option Group with a name containing spaces cannot have any options ad...2019-12-02T06:07:08Zjustinfreeman (Agileware)CiviCRM Option Group with a name containing spaces cannot have any options added, error message is shown also impacts the in-place option editorCiviCRM Option Group with a name containing spaces cannot have any options added, error message is shown also impacts the in-place option editor.
The Name field is mandatory on an Option Group and no guidance is given to the user about ...CiviCRM Option Group with a name containing spaces cannot have any options added, error message is shown also impacts the in-place option editor.
The Name field is mandatory on an Option Group and no guidance is given to the user about what value should be entered. No validation is performed on this field to prevent an invalid value from being entered.
The workaround is to **remove the spaces from the Name field value**.
Bug is shown in the screen recording below. Reproduced on CiviCRM 5.21.alpha1 - https://dmaster.demo.civicrm.org/
Agileware Ref: CIVICRM-1373
![in-place-editor-option-group](/uploads/ff54799f03f1af4926c1692548ab2d28/in-place-editor-option-group.png)
![jKq5sOxNx2](/uploads/542b18ecfe68ab3d957f00eda58ecc32/jKq5sOxNx2.gif)5.21.0justinfreeman (Agileware)justinfreeman (Agileware)