CiviCRM Core issueshttps://lab.civicrm.org/dev/core/-/issues2020-10-07T19:45:57Zhttps://lab.civicrm.org/dev/core/-/issues/2013Line Item support in 'create search' - create smart group2020-10-07T19:45:57ZeileenLine Item support in 'create search' - create smart groupSo in trying to define a way in which line items in search might be useful I have this issue to define a first use case
Goal - create a smart group of all contacts with the line items of price field value 'General' in Price set 'Members...So in trying to define a way in which line items in search might be useful I have this issue to define a first use case
Goal - create a smart group of all contacts with the line items of price field value 'General' in Price set 'Membership Amount' (this is a bit of an artificial choice of line item but it's on default installs)
I had some success but could not link back to contacts...
![Screen_Shot_2020-09-11_at_11.26.29_AM](/uploads/1f07529473cd70d6d7d58cdac8cbbc37/Screen_Shot_2020-09-11_at_11.26.29_AM.png)
@colemanw5.31.0https://lab.civicrm.org/dev/core/-/issues/2009Grant dashboard counts trashed contacts2020-09-10T22:21:10ZlcdwebGrant dashboard counts trashed contactsThe grant dashboard tallies include contacts that are trashed and shouldn't. To reproduce:
* observe current dashboard stats for a specific status
* create a contact and create a grant with that same status
* trash the contact
* observe...The grant dashboard tallies include contacts that are trashed and shouldn't. To reproduce:
* observe current dashboard stats for a specific status
* create a contact and create a grant with that same status
* trash the contact
* observe the dashboard stats. it will have incremented by 1, including the trashed record
If you click the hyperlink to search for grants the trashed record is properly excluded. It's just the dashboard stats that are off.5.31.0lcdweblcdwebhttps://lab.civicrm.org/dev/core/-/issues/2008Permissions problem on add or edit template2020-09-16T22:47:34ZTony Maynard-SmithPermissions problem on add or edit templateOverview
----------------------------------------
A User with the permissions Access CiviCRM backend and API, Access AJAX API, Edit message templates, Edit user-driven message templates can view existing templates, open the form to add o...Overview
----------------------------------------
A User with the permissions Access CiviCRM backend and API, Access AJAX API, Edit message templates, Edit user-driven message templates can view existing templates, open the form to add or edit one, but gets a fatal error on trying to save it.
This is a regression between 5.24 which worked, and 5.28.2 which does not.
See also https://civicrm.stackexchange.com/questions/36233/problem-with-permissions-to-edit-message-templates
Reproduction steps
----------------------------------------
1. Set up user with above permissions
2. Go to Mailings -> Message Templates
3. Click Add Template, fill in Title, Subject and a single line of plain text in the content.
4. Click Save and Done.
Current behaviour
----------------------------------------
Get the attached error message, Authorisation Failure ...
![Template_Error](/uploads/dbce1fac8fb0ec17862bbbb92a57b84d/Template_Error.PNG)
Expected behaviour
----------------------------------------
Should save correctly.
Environment information
----------------------------------------
* __Browser:__ Firefox / Chrome
* __CiviCRM:__ 5.28.2. Worked correctly in 5.24.
* __PHP:__ 7.2.33
* __CMS:__ Drupal 7.72 (Also reported on Joomla)5.30.0https://lab.civicrm.org/dev/core/-/issues/2006Token Processor refactoring (make core token classes accessible outside sched...2021-10-02T05:30:43ZseamusleeToken Processor refactoring (make core token classes accessible outside scheduled reminder context)Gitlab for pR https://github.com/civicrm/civicrm-core/pull/16983Gitlab for pR https://github.com/civicrm/civicrm-core/pull/169835.43.0https://lab.civicrm.org/dev/core/-/issues/2003Incorrect rounding up with priceset fields2020-12-30T16:59:35ZjaapjansmaIncorrect rounding up with priceset fields**How to reproduce**
1. Set decimal separator to , [comma]
2. Set thousand separator to . [dot]
3. Go to administer --> CiviContribute --> Manage Price Fields
4. Add a price set
5. Add a price field of type option
6. Add an option with ...**How to reproduce**
1. Set decimal separator to , [comma]
2. Set thousand separator to . [dot]
3. Go to administer --> CiviContribute --> Manage Price Fields
4. Add a price set
5. Add a price field of type option
6. Add an option with value 12,987654321
7. Add an option with value 9,87
8. Add an option with value 123.456.789,987654321
**Actual result**
* The option in step 6 becomes **12,00**
* The option of step 7 becomes **9,00**
* The option of step 8 becomes **123.456.789,99**
Note the rounding with zero's for step 6 and 7 and the correct but unwanted rounding of step 8.
**Expected result**
* The option in step 6 stays **12,987654321**
* The option of step 7 stays **9,87**
* The option of step 8 stays **123.456.789,987654321**
**See also**
We discovered this issue whilst we were testing [PR 18297](https://github.com/civicrm/civicrm-core/pull/18297)
**Tested in**
dmaster (5.31.alpha1)5.31.0https://lab.civicrm.org/dev/core/-/issues/1998Merging Contacts causes DB Error: Already Exists - Duplicate entry on civicrm...2020-09-06T21:45:17ZmasettoMerging Contacts causes DB Error: Already Exists - Duplicate entry on civicrm_dashboard_contact tableI have a problem similar to [this issue](https://lab.civicrm.org/dev/core/-/issues/1934) if I try to merge 2 contacts.
I'm using CiviCRM 5.28.3 on Wordpress.
This query:
```
UPDATE civicrm_dashboard_contact SET contact_id = 19296 WHERE...I have a problem similar to [this issue](https://lab.civicrm.org/dev/core/-/issues/1934) if I try to merge 2 contacts.
I'm using CiviCRM 5.28.3 on Wordpress.
This query:
```
UPDATE civicrm_dashboard_contact SET contact_id = 19296 WHERE contact_id = 19050
```
gives this MySQL error:
```
[nativecode=1062 ** Duplicate entry '1-19296' for key 'index_dashboard_id_contact_id']
```
```
Error Details = Array
(
[callback] => Array
(
[0] => CRM_Core_Error
[1] => handle
)
[code] => -5
[message] => DB Error: already exists
[mode] => 16
[debug_info] => UPDATE civicrm_dashboard_contact SET contact_id = 19296 WHERE contact_id = 19050 [nativecode=1062 ** Duplicate entry '1-19296' for key 'index_dashboard_id_contact_id']
[type] => DB_Error
[user_info] => UPDATE civicrm_dashboard_contact SET contact_id = 19296 WHERE contact_id = 19050 [nativecode=1062 ** Duplicate entry '1-19296' for key 'index_dashboard_id_contact_id']
[to_string] => [db_error: message="DB Error: already exists" code=-5 mode=callback callback=CRM_Core_Error::handle prefix="" info="UPDATE civicrm_dashboard_contact SET contact_id = 19296 WHERE contact_id = 19050 [nativecode=1062 ** Duplicate entry '1-19296' for key 'index_dashboard_id_contact_id']"]
)
...
#13.. /wp-content/plugins/civicrm/civicrm/CRM/Dedupe/Merger.php(595): CRM_Core_DAO::executeQuery("UPDATE civicrm_dashboard_contact SET contact_id = 19296 WHERE contact_id = 19050", (Array:0), TRUE, NULL, TRUE)
#14 .../wp-content/plugins/civicrm/civicrm/CRM/Dedupe/Merger.php(1351): CRM_Dedupe_Merger::moveContactBelongings(Object(CRM_Dedupe_MergeHandler), (Array:9), (Array:0))
#15 .../wp-content/plugins/civicrm/civicrm/CRM/Contact/Form/Merge.php(308): CRM_Dedupe_Merger::moveAllBelongings(19296, 19050, (Array:40))
```5.29.1https://lab.civicrm.org/dev/core/-/issues/1997PayPal Standard redirect fails on WordPress2022-12-13T17:36:37ZkcristianoPayPal Standard redirect fails on WordPressStarting in CiviCRM 5.28 the following occurson any contribution or event page - shortcode, cleanurl, ugly url
- Complete a donation page using PayPal Standard
- Click continue
- Go To PayPal
- Make payment
- Return to merchant (either...Starting in CiviCRM 5.28 the following occurson any contribution or event page - shortcode, cleanurl, ugly url
- Complete a donation page using PayPal Standard
- Click continue
- Go To PayPal
- Make payment
- Return to merchant (either via auto return or clicking the return to merchant button)
![image](/uploads/bef50def6e6a1546e2a003c58e2b62fc/image.png)
Return URL is:
`https://wpcv.test/civicrm/?civiwp=CiviCRM&q=civicrm%2Fcontribute%2Ftransact&_qf_ThankYou_display=1&qfKey=1eeb07cdbc6ad45b89ca33a18ef246354bfffba1b89c76989d57f74685b5412a_1724`
**Contribution completes in CiviCRM, but the user is stuck on an error page**
From Log:
```
Sep 03 11:16:07 [info] $IDS Detector Details = Array
(
[0] => Array
(
[name] => custom
[value] => {"module":"contribute","contactID":"202","contributionID":160,"contributionPageID":1}
[page] => /civicrm/?civiwp=CiviCRM&q=civicrm%2Fcontribute%2Ftransact&_qf_ThankYou_display=1&qfKey=1eeb07cdbc6ad45b89ca33a18ef246354bfffba1b89c76989d57f74685b5412a_1724
[userid] =>
[session] => 59k48kf3tamh8oh6q1fo8220al
[ip] => x.x.x.x
[reaction] => 0
[impact] => 32
)
)
Sep 03 11:16:07 [error]
$Fatal Error Details = array(3) {
["message"]=>
string(627) "We can't load the requested web page. This page requires cookies to be enabled in your browser settings. Please check this setting and enable cookies (if they are
not enabled). Then try again. If this error persists, contact the site administrator for assistance.<br /><br />Site Administrators: This error may indicate that users are acce
ssing this page using a domain or URL other than the configured Base URL. EXAMPLE: Base URL is http://example.org, but some users are accessing the page via http://www.example.o
rg or a domain alias like http://myotherexample.org.<br /><br />Error type: Could not find a valid session key."
["code"]=>
NULL
["exception"]=>
object(CRM_Core_Exception)#2525 (10) {
["errorData":"CRM_Core_Exception":private]=>
array(1) {
["error_code"]=>
int(0)
}
["cause":protected]=>
NULL
["_trace":"PEAR_Exception":private]=>
NULL
["message":protected]=>
string(627) "We can't load the requested web page. This page requires cookies to be enabled in your browser settings. Please check this setting and enable cookie[1270/99292]
re not enabled). Then try again. If this error persists, contact the site administrator for assistance.<br /><br />Site Administrators: This error may indicate that users are ac
cessing this page using a domain or URL other than the configured Base URL. EXAMPLE: Base URL is http://example.org, but some users are accessing the page via http://www.example
.org or a domain alias like http://myotherexample.org.<br /><br />Error type: Could not find a valid session key."
```
```
Sep 03 11:16:09 [debug] PayPalIPN: Received (ContactID: 202; trxn_id: XXXXXXXXX).
Sep 03 11:16:09 [info] Contribution record updated successfully
Sep 03 11:16:09 [info] Receipt sent
Sep 03 11:16:09 [info] Success: Database updated
```
The session Id above matches the session ID in my browser console.5.30.0https://lab.civicrm.org/dev/core/-/issues/1994LineItem pre Hook non-standard on edit2020-09-06T19:44:12ZeileenLineItem pre Hook non-standard on editThe pre hook passes $params['entity_id'] for 'id' when it should pass null
```
$id = $params['id'] ?? NULL;
if ($id) {
CRM_Utils_Hook::pre('edit', 'LineItem', $id, $params);
}
else {
CRM_Utils_Hook::pre('crea...The pre hook passes $params['entity_id'] for 'id' when it should pass null
```
$id = $params['id'] ?? NULL;
if ($id) {
CRM_Utils_Hook::pre('edit', 'LineItem', $id, $params);
}
else {
CRM_Utils_Hook::pre('create', 'LineItem', $params['entity_id'], $params);
}
```
@lcdweb @JoeMurray @seamuslee @pradeep @monish.deb - can we fix this?5.30.0https://lab.civicrm.org/dev/core/-/issues/1989E_WARNING when editing custom field with trigger-based logging turned on2020-09-06T20:47:11ZDaveDE_WARNING when editing custom field with trigger-based logging turned on1. Turn on logging (admin - system settings - misc).
2. Turn off popups so you can see the warning (admin - customize - display prefs) (or install the loudnotices extension).
3. Edit an existing custom field, e.g. just change the label, ...1. Turn on logging (admin - system settings - misc).
2. Turn off popups so you can see the warning (admin - customize - display prefs) (or install the loudnotices extension).
3. Edit an existing custom field, e.g. just change the label, or don't even do anything and just click save.
`Notice: Undefined index: ADD in CRM_Logging_Schema->fixSchemaDifferencesFor() (line 444 of .../CRM/Logging/Schema.php).`
`Warning: Invalid argument supplied for foreach() in CRM_Logging_Schema->fixSchemaDifferencesFor() (line 444 of .../CRM/Logging/Schema.php).`
This might be sort of recent just not sure yet when it started.5.31.0https://lab.civicrm.org/dev/core/-/issues/1988api attachment.get gives fatal error for custom file fields on cases2020-09-21T21:45:54ZDaveDapi attachment.get gives fatal error for custom file fields on casesI don't really believe in custom fields on cases, but if you happen to have one of type file, api attachment get fails on it with a fatal error "Failed to match record to related entity".
1. Create a custom field of type file for case...I don't really believe in custom fields on cases, but if you happen to have one of type file, api attachment get fails on it with a fatal error "Failed to match record to related entity".
1. Create a custom field of type file for cases.
2. Create a case and upload a file in the custom field.
3. Run something like `cv ev "var_dump(civicrm_api3('attachment', 'get', ['id' => 1]));"` where 1 is the corresponding id from civicrm_file. You'll get a fatal error.
4. You can also see it by:
1. Going to Find Cases.
1. Select the case you created.
1. Choose export from the actions dropdown.
1. Choose selected fields (ignore the E_WARNINGs).
1. Pick your custom field.
1. Click Download File.
1. Aside: I don't know why you would do this csv export because if it were working the column output is a time-limited url, so maybe is useful as input to another process, but I'm not sure what else.
It happens because the api goes through a couple central functions including Civi\API\Subscriber\DynamicFKAuthorization which tries to do a lookup by calling CRM_Core_BAO_CustomGroup::getTableNameByEntityName() to find out what table the custom field "extends", but it doesn't know about cases.
This appears to be a quick fix, but I'm not sure what weirdness this might introduce elsewhere, or whether the cases omission is on purpose.
```diff
diff --git a/CRM/Core/BAO/CustomGroup.php b/CRM/Core/BAO/CustomGroup.php
index 3a0dac33f1..435982d336 100644
--- a/CRM/Core/BAO/CustomGroup.php
+++ b/CRM/Core/BAO/CustomGroup.php
@@ -1164,6 +1164,10 @@ ORDER BY civicrm_custom_group.weight,
$tableName = 'civicrm_grant';
break;
+ case 'Case':
+ $tableName = 'civicrm_case';
+ break;
+
```5.31.0https://lab.civicrm.org/dev/core/-/issues/1987Fix theme configuration section on Display preference and improve `isFrontend...2020-10-14T01:27:41Zswastik-compucorpFix theme configuration section on Display preference and improve `isFrontendPage` function for Drupal CMSProblem Motivation
----------------------------------------
While working on the Drupal web-forms, when we are using CiviCRM fields (like payment processors) on the Drupal webform pages, the CiviCRM current theme JS and CSS files were le...Problem Motivation
----------------------------------------
While working on the Drupal web-forms, when we are using CiviCRM fields (like payment processors) on the Drupal webform pages, the CiviCRM current theme JS and CSS files were leaking (rendering) on the Drupal webform page. This was making the page styling more difficult as one has to first reset the leaking CSS and then style on top of them. Also, there were some bootstrap JS libraries (when Shoreditch is the CiviCRM) file which was loading on the page. So, if a developer wants to develop a bootstrap based Drupal 7 themes and try to style the CiviCRM components, the Shoreditch bootstrap JS files conflicts with Drupal 7 bootstrap theme JS files.
To fix this we had to find a way to stop CiviCRM to apply its theme assets. The best way of it is to find a way in CiviCRM which will contextually select/deselect a CiviCRM theme on Drupal CMS pages. And apparently, the CiviCRM core provides such a feature under the display preference page to select different Front-end and Back-end theme. Unfortunately, this feature was not for Drupal CMS and hence the issue.
Problem Overview
----------------------------------------
For the Drupal CMS, the CiviCRM doesn't provide separate configurations for setting the frontend theme (FE) and the backend theme (BE). This is however present for other CMS integrations
For Drupal, on the Display Preference page, we only have one option for setting the global theme and it sets the BE only and the user can only set the BE.
![3ffa703e-9774-4224-abb0-c967b809dbef](/uploads/821e12db022a5accb4c5d8f7d8063ae3/3ffa703e-9774-4224-abb0-c967b809dbef.png)
The problem with this is that the Drupal User couldn't set the front end theme and the backend theme separately. So, to fix this we remove [the extra if logic](https://github.com/civicrm/civicrm-core/blob/master/templates/CRM/Admin/Form/Preferences/Display.tpl#L210-L225) just for Drupal CMS which hides the configuration for the FE-theme and BE-theme and loads the configuration for drupal as well. This will print both the configuration fields.
![3403e6d0-6a80-4e20-ac50-bd24190cc858](/uploads/d9efbd1d109e2bb15b0938debda8e32e/3403e6d0-6a80-4e20-ac50-bd24190cc858.png)
Also, the CiviCRM theme CSS was leaking on drupal pages too which uses the CiviCRM fields (and in turn called `civicrm_initialise()` function). This is because `$config->userSystem->isFrontEndPage()` function is buggy for Drupal CMS as it return `false` if the user opens a drupal public page. This is because [`isFrontEndPage()` function ](https://github.com/civicrm/civicrm-core/blob/master/CRM/Utils/System/DrupalBase.php#L658-L664))doesn't take care of the corner case of page URLs which are not CiviCRM's one. As it only checks if the URLs is a CiviCRM public URL
```
$item = CRM_Core_Menu::get($path);
// What if `$item` is empty?
return !empty($item['is_public']);
```
If `$item` is empty (that means it's a non-CiviCRM page) even then it returns `false` because the logic is incomplete. It doesn't check if the `$item` is empty.
This [fix](https://github.com/civicrm/civicrm-core/pull/18322) addresses both these issues.
Example use-case
----------------------------------------
1. Click on **Administration -> Customise data and screens -> Display preference**.
2. Go to `Theme` section
Current behaviour
----------------------------------------
![3ffa703e-9774-4224-abb0-c967b809dbef](/uploads/821e12db022a5accb4c5d8f7d8063ae3/3ffa703e-9774-4224-abb0-c967b809dbef.png)
Proposed behaviour
----------------------------------------
![3403e6d0-6a80-4e20-ac50-bd24190cc858](/uploads/d9efbd1d109e2bb15b0938debda8e32e/3403e6d0-6a80-4e20-ac50-bd24190cc858.png)5.31.0https://lab.civicrm.org/dev/core/-/issues/1986Propose altering the default of send notification to contributor checkbox on...2020-09-21T10:54:22ZeileenPropose altering the default of send notification to contributor checkbox on cancel or edit recurring to offWhen cancelling or updating a recurring contribution there is a checkbox to notify the contributor - this is checked by default.
I use this form a bit as a 'user' and often forget to uncheck it - which results in a pretty mindless commu...When cancelling or updating a recurring contribution there is a checkbox to notify the contributor - this is checked by default.
I use this form a bit as a 'user' and often forget to uncheck it - which results in a pretty mindless communication going out for what is usually either being done as part of a chain of communication with the donor (it's redundant) or an administrative change (the next scheduled date needs updating due to some oddity).
Because it's a rare-ish flow and 9 times out of 10 I mean to uncheck it I have never bothered to edit / maintain the message template.
I realise that I could add an extension to change the default - but my gut is that given I've seen it be problematic on 2 out of 2 sites it would probably be better that people actively choose to check the button rather than have to remember to uncheck it. If you forget to check it it's easy to send a quick email but impossible to recall if it you forget to uncheck it.5.31.0https://lab.civicrm.org/dev/core/-/issues/1983Total Tax Amount on the Contribution (generated in backoffice/offline) no lon...2020-09-01T22:57:35ZKarinGTotal Tax Amount on the Contribution (generated in backoffice/offline) no longer adds up to sum of the Tax Amount for the individual line itemsThis is 5.28.x
![image](/uploads/95bbbea641887b9709aa6d28f16c472e/image.png)
I will look into this.
Issue: tax_amount on contribution = $0 -> but it should be: $35.09 in the screenshot above.This is 5.28.x
![image](/uploads/95bbbea641887b9709aa6d28f16c472e/image.png)
I will look into this.
Issue: tax_amount on contribution = $0 -> but it should be: $35.09 in the screenshot above.5.28.4https://lab.civicrm.org/dev/core/-/issues/1982Case open: doesn't respect case roles "creator" param if unset2020-09-01T22:57:35ZlcdwebCase open: doesn't respect case roles "creator" param if unsetto replicate:
1. create a new case type
2. in the list of case roles, uncheck the "assign to creator" checkbox for the default case coordinator role
3. create a new case on a contact record
**expected result:** no case roles created
*...to replicate:
1. create a new case type
2. in the list of case roles, uncheck the "assign to creator" checkbox for the default case coordinator role
3. create a new case on a contact record
**expected result:** no case roles created
**actual result:** case coordinator role is created and assigned to the logged in user5.29.0lcdweblcdwebhttps://lab.civicrm.org/dev/core/-/issues/1980Add Line Item v4 API2020-09-10T19:29:08ZeileenAdd Line Item v4 APIIn order to do this there is some preliminary work to do as the v3 api has handling that needs to be unpacked first. In general there are 2 parts
1) Get & Delete - the goal here is to use a more conventional hook to do this in financial...In order to do this there is some preliminary work to do as the v3 api has handling that needs to be unpacked first. In general there are 2 parts
1) Get & Delete - the goal here is to use a more conventional hook to do this in financialacls core extension
2) Create - not too sure what this stuff is doing yet....5.31.0https://lab.civicrm.org/dev/core/-/issues/1979Incorrect comparison of status_id when changing status of linked cases2020-09-07T14:31:35ZDaveDIncorrect comparison of status_id when changing status of linked casesIt ends up working anyway because it will just change the status of the other case to the same thing it already was so you don't see any problem, but it's comparing wrong and you get an E_NOTICE: `Undefined index: status_id in CRM_Case_F...It ends up working anyway because it will just change the status of the other case to the same thing it already was so you don't see any problem, but it's comparing wrong and you get an E_NOTICE: `Undefined index: status_id in CRM_Case_Form_Activity_ChangeCaseStatus::beginPostProcess() (line 137 of .../CRM/Case/Form/Activity/ChangeCaseStatus.php).`
1. Create a case.
1. Create another case.
1. Create a link cases activity and link them.
1. Create a change case status activity and check the box to update related cases.
1. Click save.
It looks like it's been this way since it was implemented: https://github.com/civicrm/civicrm-core/commit/74b15fae91a220e2b1ab6f29f6e86001743eac0d#diff-784c2a130a993b23166dadf7f1ddc489R156. The available field at that point is a label not the id (the word id here would really mean option_value.value, but that's not the issue).
So two options:
1. Just remove the `if`, since that's effectively what it's been doing this whole time.
1. Include status_id in the results returned from getRelatedCases().5.31.0https://lab.civicrm.org/dev/core/-/issues/1974Changing field from Multi-Select to Select seems to still be allowed -- but i...2021-03-16T06:59:45ZnoahChanging field from Multi-Select to Select seems to still be allowed -- but is brokenOverview
----------------------------------------
When editing a Multi-Select custom field in the GUI, there are two places where the interface is misleading/broken.
### *Edit Custom Field* form
As of 5.27, "Multi-Select" is not its ...Overview
----------------------------------------
When editing a Multi-Select custom field in the GUI, there are two places where the interface is misleading/broken.
### *Edit Custom Field* form
As of 5.27, "Multi-Select" is not its own HTML type; it is the "Select" type with the "serialize" marker set to true. On the "Edit Custom Field" form ([CRM/Custom/Form/Field.php](https://github.com/civicrm/civicrm-core/blame/5.28/CRM/Custom/Form/Field.php#L328)), "serialize" is represented by a checkbox labeled "Multi-Select". This checkbox can be unchecked, but the "serialize" marker is not changed after the form is submitted.
### *Change Field Type* form
On the "Edit Custom Field" form, if the user clicks "Change Input Field Type", the "Change Field Type" form appears.
- This form still lists "Multi-Select" as an option; it is not aware of the new "serialize" scheme. So the user can change the type to "Multi-Select".
- If a field's HTML type is "Multi-Select" or "Checkbox", the user can choose to convert the field to "Select" (although this is marked "not safe"). As it has always done, Civi [updates the custom field data so that there is only one option value per record, in unserialized form](https://github.com/civicrm/civicrm-core/blob/5.28/CRM/Custom/Form/ChangeFieldType.php#L163), but new code forces the "serialize" marker to stay true, which leads to problems editing field values.
Reproduction steps
----------------------------------------
1. Create an "Alphanumeric" "Checkbox" custom field with more than one option.
1. Edit a record that has the custom field; check off at least two options and save.
1. Go back to the settings screen for the custom field; edit the field settings.
1. Click "Change Input Field Type".
1. Choose "Multi-Select" and save.
1. **Observe that "Data and Input Field" is now just "Alphanumeric"** -- the HTML type is not shown. In the database, the field has "Multi-Select" as its html_type, but this form no longer recognizes that value.
1. Click "Change Input Field Type" again.
1. Choose "Select ( Not Safe )" and save.
1. Observe the helpful warning, and click OK.
1. **Observe that "Multi-Select" is checked,** despite the fact that we supposedly just changed the field type away from Multi-Select. This is because the custom field has "serialize" set to 1, left over from the "CheckBox" type.
1. Uncheck "Multi-Select" and Save.
1. Edit the field settings again.
1. **Observe that "Multi-Select" is now checked again**, despite unchecking it and saving it.
1. Go to the record where you entered data in the custom field before.
1. **Observe that just one of the options you checked before is listed.** This is because you changed the field from Multi-Select to Select. It is expected behavior.
1. Edit the record.
1. **Observe that no value is selected** because the field data is now unserialized, but "serialize" was prevented from changing to 0, so Civi is confused. This is a regression.
Current behaviour
----------------------------------------
The UI claims to allow conversion from multi-value (serialized) types to single-value (unserialized) types, and it does convert the custom data, but doesn't flip the "serialized" switch on the custom field itself, leaving both the data and the user confused.
Expected behaviour
----------------------------------------
You should be able to convert a multi-value field to a single-value field, as you have been able to do in Civi for years. Plenty of warning is provided that this is only something you should do if you take precautions.
After converting a field in this way, the remaining (single) custom field value should appear correctly on a record's edit form.
This feature being broken is a regression.5.28.4https://lab.civicrm.org/dev/core/-/issues/1973Email & Phone storage issues in event location2020-09-18T01:07:09ZjitendraEmail & Phone storage issues in event location**Email** - Second field value cannot be saved on form submit.
To replicate -
- Navigate to Event -> Location tab - https://dmaster.demo.civicrm.org/civicrm/event/manage/location?reset=1&action=update&id=3
- Enter a value for the secon...**Email** - Second field value cannot be saved on form submit.
To replicate -
- Navigate to Event -> Location tab - https://dmaster.demo.civicrm.org/civicrm/event/manage/location?reset=1&action=update&id=3
- Enter a value for the second email field and save. The second field is empty after the form is submitted. And Email2 value is displayed on the first email field
**Phone**: Every time the Location form is submitted, a new row is inserted in phone table even if it already exist.
To replicate -
- Navigate to Event -> Location tab - https://dmaster.demo.civicrm.org/civicrm/event/manage/location?reset=1&action=update&id=3
- Fill both the phone numbers and save.
- Re-save the form without changing any value. 2 new duplicate rows have been inserted in `civicrm_phone` table.
- This happens on every submission of the Location form.
Reverting https://github.com/civicrm/civicrm-core/pull/13534/files fixes both the above issues.5.31.0https://lab.civicrm.org/dev/core/-/issues/1971Option value cache key missing domain ID can result in wrong value retrieved ...2020-08-26T19:27:09ZJKingsnorthOption value cache key missing domain ID can result in wrong value retrieved for domainI cannot provide steps to recreate the issue on dmaster because it's related to a multi-domain setup.
Our step to recreate was to:
- Log in on domain ID 1, send a test email, the 'from' address was 'test@domain1.com'
- Log in on domain ...I cannot provide steps to recreate the issue on dmaster because it's related to a multi-domain setup.
Our step to recreate was to:
- Log in on domain ID 1, send a test email, the 'from' address was 'test@domain1.com'
- Log in on domain ID 2, send a test email, the 'from' address was **still** 'test@domain1.com' (expecting @domain2.com)
In a multi-domain setup, the wrong option value for domain-sensitive option values can be returned. eg: `\CRM_Core_BAO_Domain::getNameAndEmail` returns the name and email of a different domain to the current one.
The problem stems from:
`\CRM_Core_OptionGroup::values`
The value names 'from_email_address' and 'grant_type' can be different depending on the domain ID they are looked up from.
However, the cacheKey does not include the domain ID, so the value for one domain could be cached, and returned when the query is for another domain:
`$cacheKey = self::createCacheKey($name, $flip, $grouping, $localize, $condition, $labelColumnName, $onlyActive, $keyColumnName, $orderBy);`
The domain ID is calculated lower down in the function, and is not passed in as a param.
I think this can be resolved by adding the domainID to the cache key - but only for domain-sensitive values (so as not to reduce performance for values that are shared across multiple domains).
---
I also noticed a mis-match between the current cacheKey (see above), and the one that is generated from flushValues: `$cacheKey = self::createCacheKey($name, $flip, $grouping, $localize, $condition, $labelColumnName, $onlyActive, $keyColumnName);` - the one in flushValues is missing the 'orderBy'. Is this a different problem?5.30.0https://lab.civicrm.org/dev/core/-/issues/1966Views filter on multi-select field stopped working2020-12-07T19:29:15ZPradeep Nayakpradpnayak@gmail.comViews filter on multi-select field stopped workingIn latest version of Civi multi-select field is flagged as serialize=1. Since this change was added to CiviCRM module, views failed to filter on multi-select field like multi-select, multi-select country and state.
PR: https://github.co...In latest version of Civi multi-select field is flagged as serialize=1. Since this change was added to CiviCRM module, views failed to filter on multi-select field like multi-select, multi-select country and state.
PR: https://github.com/civicrm/civicrm-drupal/pull/6155.28.3