Development issueshttps://lab.civicrm.org/groups/dev/-/issues2023-12-06T15:27:43Zhttps://lab.civicrm.org/dev/core/-/issues/3070Placeholders in forms2023-12-06T15:27:43ZshaneonabikePlaceholders in formsOverview
----------------------------------------
_Please describe your improvement in detail._
Example use-case
----------------------------------------
1. View a Contribution form
1. Fields such as _First name_ do not have a placehold...Overview
----------------------------------------
_Please describe your improvement in detail._
Example use-case
----------------------------------------
1. View a Contribution form
1. Fields such as _First name_ do not have a placeholder and only a label
Current behaviour
----------------------------------------
I think that in general providing placeholders is a good practice for all fields for the following reasons:
+ More accessible
+ Simplifies design (hidden labels) reduces the size of forms
Proposed behaviour
----------------------------------------
I was thinking there could be two ways to make this happen to start.
+ Provide placeholders that match the labels (Phase 1)
+ Provide ability on all fields with text entry to have a customizable placeholder (Phase 2)
Comments
----------------------------------------
Would there be any problem with me writing a patch that would allow the creation of placeholders for text holders that presently uses the label and copies that into a placeholder field?https://lab.civicrm.org/dev/core/-/issues/3068PDF filename on Pay later contributions is receipt.pdf2023-11-23T07:47:01Zluke.stewartPDF filename on Pay later contributions is receipt.pdfOverview
----------------------------------------
Currently if attach PDF copies to receipts is enabled and a contact completes a "pay later" contribution an email is sent with a pdf named 'receipt.pdf'
As a quick fix it is trivial to...Overview
----------------------------------------
Currently if attach PDF copies to receipts is enabled and a contact completes a "pay later" contribution an email is sent with a pdf named 'receipt.pdf'
As a quick fix it is trivial to detect in CRM/Contribute/BAO/ContributionPage::sendMail whether the payment is pay later or not and use this to change the PDF name.
We also need to check other workflows that trigger pdfs receipts.
These look to be CRM/Contribute/BAO/ContributionSoft.php which should be a similar fix to above - and also consider workflows for resending "receipts" where this is hardcoded as well.
Long term this value wouldn't be hard coded in this file but exposed through the UI as either a global setting - or potentially having a per contribution page override.
Additionally as it is currently this is not a translateable string either.
Reproduction steps
----------------------------------------
1. Enable "Attach PDF copy to receipts" via Admin -> System Settings -> Misc
1. Create a contribution page with a pay later and payment processor (dummy processor is fine) and add a $1 payment.
1. Under the Receipt options -> "Email Receipt to Contributor?" set true.
Current behaviour
----------------------------------------
When submitting the contribution form with "Pay Later" the email has "Invoice" in the subject - but the attachment filename is "receipt.pdf"
Expected behaviour
----------------------------------------
When submitting the contribution form with "Pay Later" the email has "Invoice" in the subject - but the attachment filename is "receipt.pdf"
Environment information
----------------------------------------
* __CiviCRM:__ _Master ( and Current Stable 5.46.2.)https://lab.civicrm.org/dev/core/-/issues/3067Improving performance of retreiving display names for multivalued custom data2022-11-25T15:39:20ZMichael McAndrewImproving performance of retreiving display names for multivalued custom data.Have been taking a look at https://github.com/civicrm/civicrm-core/pull/20764/files#diff-36ab608da0b5718996afd18c10a8c12653c2a1675e81fd3c4dc3e40c2ebb25d2R1040.
My hunch is that for a query that returns 50,000 rows, the 'group_concat fi....Have been taking a look at https://github.com/civicrm/civicrm-core/pull/20764/files#diff-36ab608da0b5718996afd18c10a8c12653c2a1675e81fd3c4dc3e40c2ebb25d2R1040.
My hunch is that for a query that returns 50,000 rows, the 'group_concat find_in_set' subquery is executed 50,000 times even if pagination is turned on since the limit is applied after it does all the subqueries
If you turn that subquery into a 'superquery', i.e. you do the 'group_concat find_in_set' hydration after the limit, it imrpoves the performance a lot.
I did a proof of concept below. For a query with 500 results it went from 37 seconds to 1.3 seconds.
And for 34,000 it went from never completing to 1.0 seconds.
Not sure how easy it would be to acheive this within the constraints of searchkit @colemanw but it would be great to get your initial thoughts on this.
Proof of concept changes to the query below...
Changing this query:
```sql
SELECT `a`.`id`, (
SELECT GROUP_CONCAT(
`display_name`
ORDER BY FIND_IN_SET(`civicrm_contact`.`id`, REPLACE(`Case_of_abuse_details_1`.`perpetrator_143`, '�', ','))
SEPARATOR '�'
)
FROM `civicrm_contact`
WHERE FIND_IN_SET(`civicrm_contact`.`id`, REPLACE(`Case_of_abuse_details_1`.`perpetrator_143`, '�', ','))
) AS `Case_of_abuse_details.Perpetrator.display_name`
FROM civicrm_activity a
LEFT JOIN `civicrm_value_case_of_abuse_68` `Case_of_abuse_details_1` ON a.id = Case_of_abuse_details_1.entity_id
WHERE ((`a`.`activity_type_id` IS NULL OR (`a`.`activity_type_id` IN (1, 2, 3, 4, 5, 9, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 40, 44, 45, 48, 49, 50, 51, 52, 53, 55, 57, 59, 61, 63, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74)))) AND (`a`.`activity_type_id` = "68") AND (`a`.`is_test` = "0") AND (`a`.`is_deleted` = "0")
GROUP BY `a`.`id`
LIMIT 50
OFFSET 0
```
into this query
```sql
SELECT id,(SELECT GROUP_CONCAT(
`display_name`
ORDER BY FIND_IN_SET(`civicrm_contact`.`id`, REPLACE(`perpetrator_143`, '�', ','))
SEPARATOR '�'
)
FROM `civicrm_contact`
WHERE FIND_IN_SET(`civicrm_contact`.`id`, REPLACE(`perpetrator_143`, '�', ','))
) AS `Case_of_abuse_details.Perpetrator.display_name` FROM (SELECT `a`.`id`, `Case_of_abuse_details_1`.`perpetrator_143`
FROM civicrm_activity a
LEFT JOIN `civicrm_value_case_of_abuse_68` `Case_of_abuse_details_1` ON a.id = Case_of_abuse_details_1.entity_id
WHERE ((`a`.`activity_type_id` IS NULL OR (`a`.`activity_type_id` IN (1, 2, 3, 4, 5, 9, 12, 13, 14, 15, 16, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 40, 44, 45, 48, 49, 50, 51, 52, 53, 55, 57, 59, 61, 63, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74)))) AND (`a`.`activity_type_id` = "68") AND (`a`.`is_test` = "0") AND (`a`.`is_deleted` = "0")
GROUP BY `a`.`id`
LIMIT 50
OFFSET 0) AS alias
```https://lab.civicrm.org/dev/core/-/issues/3065(Regression) Strict typing on CRM_Contact_BAO_Contact::getDuplicateContacts()...2023-11-23T05:03:25ZJonGold(Regression) Strict typing on CRM_Contact_BAO_Contact::getDuplicateContacts() causes fatal error[PR 22394](https://github.com/civicrm/civicrm-core/pull/22394) adds strict type checking, which causes a fatal error with inputs that were previously acceptable.
### Steps to replicate
Run `cv api Contact.duplicatecheck` with no argume...[PR 22394](https://github.com/civicrm/civicrm-core/pull/22394) adds strict type checking, which causes a fatal error with inputs that were previously acceptable.
### Steps to replicate
Run `cv api Contact.duplicatecheck` with no arguments.
### Result in 5.45
```
{
"is_error": 0,
"version": 3,
"count": 0,
"values": []
}
```
### Result in 5.46
```
[Symfony\Component\Debug\Exception\FatalThrowableError]
Type error: Argument 1 passed to CRM_Contact_BAO_Contact::getDuplicateContacts() must be of the type array, null given, called in /home/jon/local/civicrm-buildkit/build/dmaster/web/sites/all/modules/civicrm/api/v3/Contact.php on line 1611
```
Now, passing no arguments should arguably not be supported, but a typical usage is to leave the rule type undefined, which defaults to `Unsupervised`. Now, leaving it undefined gives an error of "Argument 3 must be a string, null given".
Since this is a bug that will bite a lot of folks, I'm going to do a quick PR to allow these arguments to be nullable - but I imagine in the long term we want to modify the calling functions to pass valid values. Though I think that argument 3 (`$rule`) should always be nullable.JonGoldJonGoldhttps://lab.civicrm.org/dev/core/-/issues/3064Why is first name & last name OR email required on individual contact import?2022-02-20T23:58:45ZStoobWhy is first name & last name OR email required on individual contact import?What if all I want is to match on Contact ID or External ID to fill or update some other fields?
On _dmaster_ attempting to import without fails ungracefully at step 3 with this error:
> Mandatory key(s) missing from params array: one o...What if all I want is to match on Contact ID or External ID to fill or update some other fields?
On _dmaster_ attempting to import without fails ungracefully at step 3 with this error:
> Mandatory key(s) missing from params array: one of (first_name, last_name, email, display_name)https://lab.civicrm.org/dev/core/-/issues/3062APIv4: Case activities ignores the time value passed via start_date using cre...2023-11-23T05:03:24ZKurund JalmiAPIv4: Case activities ignores the time value passed via start_date using create apiCase create API.
```php
$results = \Civi\Api4\CiviCase::create()
->addValue('case_type_id', 4)
->addValue('status_id', 9)
->addValue('contact_id', [
'user_contact_id',
])
->addValue('start_date', '2022-02-08 18:51:00')
-...Case create API.
```php
$results = \Civi\Api4\CiviCase::create()
->addValue('case_type_id', 4)
->addValue('status_id', 9)
->addValue('contact_id', [
'user_contact_id',
])
->addValue('start_date', '2022-02-08 18:51:00')
->execute();
```
```php
(1) [
{
"id": 578,
"case_type_id": 4,
"start_date": "2022-02-08",
"status_id": 9,
"is_deleted": false,
"created_date": "2022-02-08 18:51:00",
"modified_date": "2022-02-08 18:51:00"
}
]
```
Case is created correctly. However, associated activities ignores the time. My assumption was `start_date` value is used for creating activities. This happens when a case is created via UI.
```php
(1) [
{
"id": 120,
"source_record_id": null,
"activity_type_id": 13,
"subject": "test",
"activity_date_time": "2022-02-08 00:00:00",
"duration": null,
"location": null,
"phone_id": null,
"phone_number": null,
"details": null,
"status_id": 2,
"priority_id": 2,
"parent_id": null,
"is_test": false,
"medium_id": 7,
"is_auto": false,
"relationship_id": null,
"is_current_revision": true,
"original_id": null,
"result": null,
"is_deleted": false,
"campaign_id": null,
"engagement_level": null,
"weight": null,
"is_star": false,
"created_date": "2022-02-08 18:51:00",
"modified_date": "2022-02-08 18:51:00"
}
]
```https://lab.civicrm.org/dev/core/-/issues/3061"Country" multiselect custom field won't support more than 50-or-so countries2023-11-25T05:03:16ZAllenShaw"Country" multiselect custom field won't support more than 50-or-so countriesOn dmaster.demo.civicrm.org ("Powered by CiviCRM 5.48.alpha1."):
- Create a custom field of type Country, set to multi-select, in any custom group
- Edit an entity using this custom field, and try to add more than 50-or-so countries to ...On dmaster.demo.civicrm.org ("Powered by CiviCRM 5.48.alpha1."):
- Create a custom field of type Country, set to multi-select, in any custom group
- Edit an entity using this custom field, and try to add more than 50-or-so countries to it.
- Trying to save this entity will generate fatal error: "DB Error: unknown error" (on our site running CiviCRM 5.35.2, the entity will save without error, but only the first 50-or-so options are saved in the field; additional options are truncated out; this difference may be due to mysql configuration rather than civicrm version.)
This appears to be due to the `varchar(255)` column specification for the custom field storage.
On our own site, we resolved this by altering the column to `varchar(2550)`; that's probably much larger than is needed, but by doing this we can now select all options in this field and save the entity without error, retaining all selected options.
E.g.
```
ALTER TABLE `civicrm_value_additional_contact_info_2` CHANGE `locations_43` `locations_43` varchar(2550);
```https://lab.civicrm.org/dev/core/-/issues/3058Backend membership renewal does not attach the invoice PDF2022-06-24T03:36:05ZbgmBackend membership renewal does not attach the invoice PDFTo reproduce:
* Enable Taxes and Invoicing (Administer > CiviContribute > CiviContribute Component Settings)
* Enable "Automatically email invoice when user purchases online"
Then go to a contact record
* Make sure the contact has an ...To reproduce:
* Enable Taxes and Invoicing (Administer > CiviContribute > CiviContribute Component Settings)
* Enable "Automatically email invoice when user purchases online"
Then go to a contact record
* Make sure the contact has an email address on their record (you probably want to update to your own email address)
* Add a Membership (without CC payment), record a payment (ex: cheque or whatever).
They should receive an email confirmation, with the invoice.pdf attached.
Now go back to their contact record, and renew the membership (again, no need for a CC payment). They will be emailed with a receipt, but the invoice.pdf will not be attached.
As a tangential issue: for taxes we have custom smarty (from the taxcalculator extension) that requires the `$contributionID` in the template. It works fine for the "offline new membership" but not for renewal, the variable is undefined.
I tried comparing the `submit` functions for `CRM/Membership/Form/Membership.php` vs `MembershipRenewal.php`, but it's not an easy one. They have a lot of similarities, but also major differences in how they process the contribution.https://lab.civicrm.org/dev/user-interface/-/issues/45Introduce a way to link event participants from the associated booking.2023-06-20T22:57:12ZBradley TaylorIntroduce a way to link event participants from the associated booking.When an event booking is made, the booking is stored across two primary entities:
- One or more participants
- One contribution
When you view an event participant, the list of associated payments is listed at the bottom of that screen:...When an event booking is made, the booking is stored across two primary entities:
- One or more participants
- One contribution
When you view an event participant, the list of associated payments is listed at the bottom of that screen:
![Screenshot_2022-02-04_at_08.46.02](/uploads/e8b76fabe84694810861ace5ecfef8b9/Screenshot_2022-02-04_at_08.46.02.png)
However, the reverse is not true. There is no way to easily get to the participants, when viewing a contriubtion:
![Screenshot_2022-02-04_at_08.46.41](/uploads/a1e19956ed2bda850fea737ca2eca33e/Screenshot_2022-02-04_at_08.46.41.png)
This can make it harder for administrators to see what a contribution has been used to purchase, and harder to see what additional participants the primary booker booked.
I've not looked into the feasability of either approach, but I can see a couple of obvious ways of fitting this into the UI.
**Option 1.** Link each event line item in the line items table to the relevant participant:
![Screenshot_2022-02-04_at_08.48.17](/uploads/cba5c2fb9239c82ecedaefe02adaa31d/Screenshot_2022-02-04_at_08.48.17.png)
(I'm not sure how this option would work with the line item editor extension)
**Option 2.** Introduce a new table of participants:
![Screenshot_2022-02-04_at_08.53.53](/uploads/c3565698dff7fae04900f47226526643/Screenshot_2022-02-04_at_08.53.53.png)
Similar thinking could be employed to link to the associated membership to a membership payment, but I thought I'd get the conversation going in relation to event bookings first.https://lab.civicrm.org/dev/core/-/issues/3054Searchkit: add an ability to embed searckit on normal forms when viewed in popup2023-11-20T16:18:07ZKurund JalmiSearchkit: add an ability to embed searckit on normal forms when viewed in popup### Current behavior
Currently, we can load the Searckit on a normal form only if it's opened in a new tab. Popup displays generates angular errors.
Below code is added using buiildForm hook.
Here is the working code:
```
Civi::se...### Current behavior
Currently, we can load the Searckit on a normal form only if it's opened in a new tab. Popup displays generates angular errors.
Below code is added using buiildForm hook.
Here is the working code:
```
Civi::service('angularjs.loader')->addModules('afformActivityImages');
$markup = '
<div id="bootstrap-theme" class="crm-activity-form-images">
<crm-angular-js modules="afformActivityImages">
<afform-activity-images options="{aid:' . $activityId . '}"></afform-activity-images>
</crm-angular-js>
</div>
';
CRM_Core_Region::instance('page-body')->add([
'markup' => $markup,
]);
```
Above Searckit display shows the images associated with the activity record.
### Expected behavior
It should also work when the form is loaded in popup modehttps://lab.civicrm.org/dev/core/-/issues/3053Usability issue reported by user: All Reports page overrides report results s...2023-11-20T05:03:18ZDevAppUsability issue reported by user: All Reports page overrides report results settingWhen clicking on a report name on the All Reports page located at /wp-admin/admin.php?page=CiviCRM&q=civicrm%2Freport%2Flist&reset=1
The resulting link loads the report with output=criteria on the end. This stops the default parameters ...When clicking on a report name on the All Reports page located at /wp-admin/admin.php?page=CiviCRM&q=civicrm%2Freport%2Flist&reset=1
The resulting link loads the report with output=criteria on the end. This stops the default parameters of the results from loading, which was set to view results. The user expected results to appear when loading the report per the saved report setting. The result to the user is the report is broken.
The output=criteria is overriding the saved report behaviour. Whilst there is a view results button the right hand side of the All Reports page, it does create some confusion to the user with consistency. Perhaps if the setting is already set on the report to view results, the output=criteria could be removed from that link to create consistency... Or the GUI clearer about why the report wasn't run.
This isn't a bug, but more a usability issue.https://lab.civicrm.org/dev/wordpress/-/issues/118Make CiviCRM's menu position an integer2022-03-17T20:45:35ZhaystackMake CiviCRM's menu position an integerIn WordPress 6.0, menu positions must be integers otherwise a `doing_it_wrong` error is triggered. CiviCRM currently sets the position to [a float expressed as a string](https://github.com/civicrm/civicrm-wordpress/blob/cce8f826a292ecceb...In WordPress 6.0, menu positions must be integers otherwise a `doing_it_wrong` error is triggered. CiviCRM currently sets the position to [a float expressed as a string](https://github.com/civicrm/civicrm-wordpress/blob/cce8f826a292ecceb9b04b93db4b38a17566eb08/includes/civicrm.admin.php#L600-L609) - this will need to be changed in due course.haystackhaystackhttps://lab.civicrm.org/dev/core/-/issues/3051Getting error when using custom searches2023-02-06T05:42:27ZErikHommelGetting error when using custom searchesOverview
----------------------------------------
When using a custom search (including most of the ones shipped with core but also ones in extensions) I can not select a single row and get this error:
```
User deprecated function: Depr...Overview
----------------------------------------
When using a custom search (including most of the ones shipped with core but also ones in extensions) I can not select a single row and get this error:
```
User deprecated function: Deprecated function CRM_Contact_Selector::fillupPrevNextCache,
use Custom searches should return sql capable of filling the prevnext cache..
in CRM_Core_Error::deprecatedFunctionWarning()
(regel 1044 van /var/www/html/speeltuin/sites/all/modules/civicrm/CRM/Core/Error.php).
```
Investigation shows that the error originates from the `fillWithSql` function in `CRM_Core_PrevNextCache_Sql`. This does not work in combination with the `count()` function in most custom searches. This means the next prev cache is not filled nor does the select option work.
Tested with 5.41.1 and replicated on dmaster.
Reproduction steps
----------------------------------------
1. Click on **Search>Custom Searches** and select Zip Code Range from the list
1. Select 1 as from and 9999 to search for the range
Current behaviour
----------------------------------------
* This error is one in the list of errors:
```
User deprecated function: Deprecated function CRM_Contact_Selector::fillupPrevNextCache,
use Custom searches should return sql capable of filling the prevnext cache..
in CRM_Core_Error::deprecatedFunctionWarning()
(line 1043 of /srv/buildkit/build/dmaster/web/sites/all/modules/civicrm/CRM/Core/Error.php).
```
* Try to select a single line, only selecting all rows will work
Expected behaviour
----------------------------------------
I should be able to select a single row or a couple of rows and perform actions on the selected ones
Environment information
----------------------------------------
* __Browser:__ _Firefox 95.0 (Linux Mint)
* __CiviCRM:__ _Master/5.41.1
* __PHP:__ _7.3__
* __CMS:__ _Drupal 7.81_
* __Database:__ _MySQL 5.7.7
* __Web Server:__ _Apache 2.4
Comments
----------------------------------------
Although custom searches are slowly being faded out this error breaks existing functionality so I think it is a regression? I think it certainly makes sense to remove the custom searches from future versions and encourage the usage of SearchKit. There are however quite a few extensions out there that use Custom Searches, and the Developer Guide still explains the civix _generate:search_. So I think this should be fixed AND the Developer Guide should be updated with instructions how we actually now want the PrevNext filled and used?
Happy to update the Developer Guide if someone can explain me what is required for the PrevNext new style?https://lab.civicrm.org/dev/core/-/issues/3050Error thrown when 'remove'ing from CiviContribute Batch2022-11-02T00:48:39ZmarshError thrown when 'remove'ing from CiviContribute BatchOverview
----------------------------------------
Civi throws an error when working with Accounting Batches. It's kind of hard to pin down - the front end gives the default / standard / very helpful
No response from the server. Check yo...Overview
----------------------------------------
Civi throws an error when working with Accounting Batches. It's kind of hard to pin down - the front end gives the default / standard / very helpful
No response from the server. Check your internet connection and try reloading the page.
Reproduction steps
----------------------------------------
- add a new accounting Batch (Contributions > Accounting Batches > New Batch)
- Assign a contribution to the batch
- try to remove the contribution from the batch
- at this point the message is displayed:
message, although ConfigAndLog does give a bit more, i.e.:
$Fatal Error Details = array:3 [
"message" => "Cannot delete EntityBatch with no id."
"code" => null
"exception" => CRM_Core_Exception {#2039
-errorData: array:1 [
"error_code" => 0
]
#cause: null
-_trace: null
#message: "Cannot delete EntityBatch with no id."
#code: 0
#file: "/var/www/html/drupal7/sites/all/modules/civicrm/CRM/Core/DAO.php"
#line: 958
trace: {
/var/www/html/drupal7/sites/all/modules/civicrm/CRM/Core/DAO.php:958 {
› if (empty($record['id'])) {
› throw new CRM_Core_Exception("Cannot delete {$entityName} with no id.");
› }
}
/var/www/html/drupal7/sites/all/modules/civicrm/CRM/Batch/BAO/EntityBatch.php:39 { …}
/var/www/html/drupal7/sites/all/modules/civicrm/CRM/Financial/Page/AJAX.php:207 { …}
/var/www/html/drupal7/sites/all/modules/civicrm/CRM/Utils/REST.php:266 { …}
/var/www/html/drupal7/sites/all/modules/civicrm/CRM/Utils/REST.php:550 { …}
/var/www/html/drupal7/sites/all/modules/civicrm/CRM/Core/Invoke.php:279 { …}
/var/www/html/drupal7/sites/all/modules/civicrm/CRM/Core/Invoke.php:69 { …}
/var/www/html/drupal7/sites/all/modules/civicrm/CRM/Core/Invoke.php:36 { …}
/var/www/html/drupal7/sites/all/modules/civicrm/drupal/civicrm.module:458 { …}
/var/www/html/drupal7/includes/menu.inc:527 { …}
/var/www/html/drupal7/index.php:21 { …}
}
}
]
This has alr3eady been [raised on stackechange](https://civicrm.stackexchange.com/questions/41126/entitybatch-with-no-id-error-when-remobing-items-from-accounting-batches?noredirect=1#comment48386_41126)
Current behaviour
----------------------------------------
![image](/uploads/f3431d6145caa54bbd5c96dec58ac3cf/image.png)
![image](/uploads/4dae3c200fc6696f0ecd6f5b25fd6747/image.png)
Expected behaviour
----------------------------------------
The item is removed from the batch
Environment information
----------------------------------------
- reproduced on dmaster
- using Chromium locally on a Debian boxhttps://lab.civicrm.org/dev/core/-/issues/3049Auto-complete option values aren't available to anonymous users2023-09-02T01:04:32ZJonGoldAuto-complete option values aren't available to anonymous usersOverview
----------------------------------------
A custom field of input type "Autocomplete-Select" doesn't return results for anonymous users, even with the "Access AJAX API" permission granted.
Reproduction steps
--------------------...Overview
----------------------------------------
A custom field of input type "Autocomplete-Select" doesn't return results for anonymous users, even with the "Access AJAX API" permission granted.
Reproduction steps
----------------------------------------
1. Change an existing field (e.g. "Soup Selection") from **Dropdown** to **Autocomplete-Select**.
1. Add the field to a profile on a public-facing event page.
1. Grant the anonymous user the **Access AJAX API** permission.
1. View as an anonymous user.
Current behaviour
----------------------------------------
No results are returned.
Expected behaviour
----------------------------------------
Results are returned, as they are with a "Dropdown" input type.
Comments
----------------------------------------
The error is that anonymous users don't have access to the "Optionvalue.getlist" API because it requires "Access CiviCRM". This seems like the wrong permission; I think "Access AJAX API" should be sufficient. From a UX perspective, it's pretty inconsistent that a Select works but not an Autocomplete-Select.
I'm proposing that we allow anonymous users to access OptionValue.get - I'm interested in whether there are use cases where this results in an information disclosure vulnerability. I can't think of any myself.https://lab.civicrm.org/dev/core/-/issues/3048Fatal error thrown in Contributions made in Year X and not Year Y custom search2023-11-19T05:03:26ZyashodhaFatal error thrown in Contributions made in Year X and not Year Y custom searchSteps to replicate :
--------------------
- Go to custom search _Contributions made in Year X and not Year Y_
- Enter _Inclusion Date One: Start/End_ and check _First time donor only?_
![demo_cus](/uploads/b03569e02aff60038ac9b4451e52...Steps to replicate :
--------------------
- Go to custom search _Contributions made in Year X and not Year Y_
- Enter _Inclusion Date One: Start/End_ and check _First time donor only?_
![demo_cus](/uploads/b03569e02aff60038ac9b4451e52be74/demo_cus.png)
- Search throws a fatal error
![dmater_error](/uploads/1607d514d535855ec6cfdd24aeadb335/dmater_error.png)
`| DebugInfo | REPLACE INTO civicrm_tmp_e_dflt_b78e21a09342a815fe62cebabffd98d6 SELECT DISTINCT contact_id AS contact_id FROM civicrm_contribution c WHERE c.is_test = 0 AND c.is_template = 0 AND c.receive_date < 2021-01-01 [nativecode=1292 ** Incorrect datetime value: '2019' for column `dmastercivi_g5lis`.`civicrm_contribution`.`receive_date` at row 1]`https://lab.civicrm.org/dev/core/-/issues/3047Contribution receipt no longer sends groupName to alterMailParams hook2022-01-30T16:44:44ZDaveDContribution receipt no longer sends groupName to alterMailParams hookLooks like it's these changes: https://github.com/civicrm/civicrm-core/pull/22615/files#diff-9a5050a22004395ee29b440cd543c11c4283cdb72563f28eae30806e5eba8cd3L418
I know there is some ongoing work to deprecate groupName etc but I thought...Looks like it's these changes: https://github.com/civicrm/civicrm-core/pull/22615/files#diff-9a5050a22004395ee29b440cd543c11c4283cdb72563f28eae30806e5eba8cd3L418
I know there is some ongoing work to deprecate groupName etc but I thought current hooks would still work for now, unless I missed it somewhere in a dev-digest.
Putting regression (in master) for the moment.https://lab.civicrm.org/dev/core/-/issues/3045Upgrade error - unknown column 'entity_modified_date' in 'civicrm_managed'2022-02-02T01:47:08ZwmortadaUpgrade error - unknown column 'entity_modified_date' in 'civicrm_managed'Overview
----------------------------------------
I've come across an issue when upgrading a site from CiviCRM 5.33.5 to CiviCRM 5.45.1.
Looking at the error log, I think the issue is that the upgrade process is trying to set the `enti...Overview
----------------------------------------
I've come across an issue when upgrading a site from CiviCRM 5.33.5 to CiviCRM 5.45.1.
Looking at the error log, I think the issue is that the upgrade process is trying to set the `entity_modified_date` in `civicrm_managed` before this field is created.
I think the error occurs when the upgrader is running the `upgrade_5_39_alpha1` in `/CRM/Upgrade/Incremental/php/FiveThirtyNine.php`. The post hook calls `/CRM/Core/BAO/Managed.php`(which was added in CiviCRM 5.45). Line 37 of which executes this SQL:
```sql
UPDATE civicrm_managed SET entity_modified_date = CURRENT_TIMESTAMP WHERE entity_type = 'SavedSearch' AND entity_id = 348;
```
This fails with an error, because `entity_modified_date` field isn't added until CiviCRM 5.45. It is added in `/CRM/Upgrade/Incremental/php/FiveFortyFive.php`.
Reproduction steps
----------------------------------------
Update from CiviCRM 5.33.5 to CiviCRM 5.45.1 using `cv upgrade:db`.
Presumably the site needs to have some saved searches that are modified in the 5.39 upgrade process.
Current behaviour
----------------------------------------
Upgrade fails with error:
```shell
Dropping SQL triggers...
Preparing upgrade...
Executing upgrade...
...................................................PHP Warning: A non-numeric value encountered in phar:///usr/local/bin/cv/vendor/symfony/console/Output/Output.php on line 145
Warning: A non-numeric value encountered in phar:///usr/local/bin/cv/vendor/symfony/console/Output/Output.php on line 145
PHP Warning: A non-numeric value encountered in phar:///usr/local/bin/cv/vendor/symfony/console/Output/Output.php on line 148
Warning: A non-numeric value encountered in phar:///usr/local/bin/cv/vendor/symfony/console/Output/Output.php on line 148
Error executing task: %s
[CiviCRM_API3_Exception]
DB Error: no such field
```
Expected behaviour
----------------------------------------
Upgrade completes successfully.
Environment information
----------------------------------------
* __Browser:__ N/A
* __CiviCRM:__ 5.33.5 to 5.45.1
* __PHP:__ 7.3
* __CMS:__ WordPress 5.4
* __Database:__ MySQL 5.7.27
* __Web Server:__ Nginx 1.15.0
Comments
----------------------------------------
Possibly related error reported here: https://civicrm.stackexchange.com/questions/41040/upgrade-fails-unknown-column-entity-modified-date
Workaround
----------------------------------------
A workaround is to upgrade to CiviCRM 5.44 first and then to CiviCRM 5.45. This fixed the problem for me with this particular site.https://lab.civicrm.org/dev/core/-/issues/3044Saving a translated message template with no text version fails2023-11-16T05:03:20ZeileenSaving a translated message template with no text version failsThe text version should not be necessary - and in fact we have general agreement to always send both
https://lab.civicrm.org/dev/core/-/issues/2866
However, when we go to save it fatals because it attempts to save the text version
![i...The text version should not be necessary - and in fact we have general agreement to always send both
https://lab.civicrm.org/dev/core/-/issues/2866
However, when we go to save it fatals because it attempts to save the text version
![image](/uploads/8e0c5b9a784bf452c2dfaa89d1aa0f33/image.png)
This is slightly complicated because the fallback for 'no text version exists' should be 'use the relevant html' not 'fall back on default language;' - so we should probably save an empty string or null or somethinghttps://lab.civicrm.org/dev/translation/-/issues/74ts() - Allow symbolic placeholders2022-01-27T13:24:34Ztottents() - Allow symbolic placeholdersOverview
---------
When writing translatable strings, placeholders must be numeric.
This leads to some quirky strings - eg if you're outputting a title and subtitle ("Some Chapter: Some Section"), the only way to encode that is `ts('%1...Overview
---------
When writing translatable strings, placeholders must be numeric.
This leads to some quirky strings - eg if you're outputting a title and subtitle ("Some Chapter: Some Section"), the only way to encode that is `ts('%1: %2')`. This string should be translatable because the layout is language dependent (eg LTR/RTL; eg punctuation-preferences), but the exported string will become meaningless when presented in Transifex (or similar). And it may be confused with other/similar strings.
Current behavior
-----------------
The function `ts(string $str, array $params)` accepts the following `$params`:
* Functional params (`count`, `plural`, `context`, `domain`, `escape`, `skip_translation`)
* Substitution params (numeric keys; `0`, `1`, `2`, ...)
As in:
```php
echo ts('Hello, %1!', [
1 => $name,
]);
echo '<li>' . ts('%1: %2', [
1 => $title,
2 => $subtitle,
]) . '</li>';
echo ts('The directory %1 is not writable. Please check your file permissions.', [
'plural' => 'The following directories are not writable: %1. Please check your file permissions.',
'count' => count($notWritableDirs),
1 => implode(', ', $notWritableDirs),
]),
```
```smarty
{ts 1=Bob}Hello %1!{/ts}
<li>{ts 1="Title" 2="Subtitle"}%1: %2{/ts}</li>
```
~~Proposed behavior (draft 1; symbol-prefix)~~
-----------------
Any `$params` which begin with a symbol (`%`, `_`, `{`, `@`, etc) will be used for variable substitution.
The earlier examples remain valid. Additionally, these examples are also valid:
```php
echo ts('Hello, %name!', [
'%name' => $name,
]);
echo '<li>' . ts('%title: %subtitle', [
'%title' => $title,
'%subtitle' => $subtitle],
) . '</li>';
echo ts('The directory %dir is not writable. Please check your file permissions.', [
'plural' => 'The following directories are not writable: %dir. Please check your file permissions.',
'count' => count($notWritableDirs),
'%dir' => implode(', ', $notWritableDirs),
]),
```
```smarty
{ts _NAME_=Bob}Hello _NAME_!{/ts}
<li>{ts _title_="Foo" _subtitle_="Bar"}_title_: _subtitle_{/ts}</li>
```
Proposed behavior (draft 2; capitalization-based)
-----------------
Any `$params` which begin with a capital letter (`[A-Z]`) will be used for variable substitution.
```php
echo ts('Hello, %NAME!', [
'NAME' => $name,
]);
echo '<li>' . ts('%TITLE: %SUBTITLE', [
'TITLE' => $title,
'SUBTITLE' => $subtitle],
) . '</li>';
echo ts('The directory %DIR is not writable. Please check your file permissions.', [
'plural' => 'The following directories are not writable: %DIR. Please check your file permissions.',
'count' => count($notWritableDirs),
'DIR' => implode(', ', $notWritableDirs),
]),
```
```smarty
{ts NAME=Bob}Hello %NAME!{/ts}
<li>{ts TITLE="Foo" SUBTITLE="Bar"}%TITLE: %SUBTITLE{/ts}</li>
```
Comments
---------
Either draft (using symbol-prefix or using uppercase) should avoid conflicts with existing strings+params. (Existing params do not begin with symbols and they are not uppercase.)
A couple factors in choosing a symbol:
* Using `%` is most consistent with current `ts()` style.
* `ts()` is used in multiple programming languages. Each has different compatibility/constraints.
* Pure PHP and pure JS are fairly flexible (`%FOO`, `{{FOO}}`, `_FOO_`, etc)
* Smarty-HTML (`{ts KEY=VALUE}...{/ts}`) is pretty limited. The bottleneck is how it parses the `KEY`.
* Angular-HTML (`{{ts('...')}}`) is in the middle. It's OK for `{{ts('%FOO')}}`, `{{ts('_FOO_')}}`, but I wouldn't count on `{{ts('{{FOO}}')}}`.
* If you want one symbol that works everywhere, `_` is probably it.
* Being flexible about symbol may be good for compatibility in the most contexts.
I suppose that the uppercase approach constrains style a bit, but maybe that's a good thing - ie you get more consistency in how `ts()` looks across environments.
Questions
---------
Are there any constraints in other layers -- eg Transifex, civistrings -- which would prevent this?
As far as I know, the only constraints which require using numeric-keys are baked into `ts()` itself.