CiviCRM Core issueshttps://lab.civicrm.org/dev/core/-/issues2023-04-12T13:09:09Zhttps://lab.civicrm.org/dev/core/-/issues/4216Primary email adress gets overwritten by profile submissions2023-04-12T13:09:09ZTobias Voigttobias.voigt@civiservice.dePrimary email adress gets overwritten by profile submissionsBehaviour:
When a profile (e.g. for a newsletter subscription) is submitted, the system searches through possible duplicates by checking, if an email address (a@a.com) already exists. If it finds an existing secondary email adress (and ...Behaviour:
When a profile (e.g. for a newsletter subscription) is submitted, the system searches through possible duplicates by checking, if an email address (a@a.com) already exists. If it finds an existing secondary email adress (and the profile is configured to retrieve the primary email adress, which makes sense for a newsletter subscription form) it overwrites the primary email (b@b.com)of the corresponding contact with the (secondary) address it found (a@a.com). The result is a contact that has two entries for email adresses (primary and secondary) that are the same (a@a.com). The former primary email (b@b.com) gets lost.
Expected behaviour:
When the system finds an existing secondary email address, it should set the marker for "Bulk Mailings" for that address. The primary email address should remain untouched.https://lab.civicrm.org/dev/core/-/issues/4218Submitting CiviMailings is flaky2023-04-24T23:29:16ZJonGoldSubmitting CiviMailings is flakyI've noticed several times that when you press "Submit Mailing" you get an error that says that submission was unsuccessful. I thought it was just me but now I'm getting user reports about it. Do others see this? I realize this isn't ...I've noticed several times that when you press "Submit Mailing" you get an error that says that submission was unsuccessful. I thought it was just me but now I'm getting user reports about it. Do others see this? I realize this isn't a proper bug report but I'm guessing this is common enough that folks can share their experiences and we can move toward a proper report.https://lab.civicrm.org/dev/core/-/issues/4219Temp table column too short in legacycustomsearches2023-04-12T07:19:23ZcatorghansTemp table column too short in legacycustomsearchesI got a "DB Error: unknown error" in "Rebuild Smart Group Cache" in the Scheduled Jobs.
In the Log file it says
"[nativecode=1406 ** Data too long for column 'group_names' at row 1]"
Which started "civicrm/ext/legacycustomsearches/CRM/C...I got a "DB Error: unknown error" in "Rebuild Smart Group Cache" in the Scheduled Jobs.
In the Log file it says
"[nativecode=1406 ** Data too long for column 'group_names' at row 1]"
Which started "civicrm/ext/legacycustomsearches/CRM/Contact/Form/Search/Custom/Group.php(435)"
What happens there just above is:
```
$this->_iGTable->createWithColumns("id int PRIMARY KEY AUTO_INCREMENT, contact_id int, group_names varchar(64)");
if ($iGroups) {
$includeGroup = "INSERT INTO {$this->_iGTableName} (contact_id, group_names)
SELECT civicrm_contact.id as contact_id, civicrm_group.title as group_name
FROM civicrm_contact
INNER JOIN civicrm_group_contact
ON civicrm_group_contact.contact_id = civicrm_contact.id
LEFT JOIN civicrm_group
ON civicrm_group_contact.group_id = civicrm_group.id";
}
```
The issue is that civicrm_group.title is varchar(255) while group_names in this temp table is varchar(64).
We had one group title which was 77 chars. When I shortened it, it worked again.
So make it "group_names varchar(255)" and it should work (or use civicrm_group.name in the select, but I suspect a reason why that was not used here)https://lab.civicrm.org/dev/core/-/issues/4220CiviCRM Activity Revisions - still some code that uses this in core2023-05-03T04:34:44Zluke.stewartCiviCRM Activity Revisions - still some code that uses this in coreFrom https://chat.civicrm.org/civicrm/pl/qxzsdqfjxf8i8cdtq31hdqnpzw and
https://chat.civicrm.org/civicrm/pl/k1pggukwfbdo9fzztjb33pikdo
There looks to be some places where is_current_revsion is still being set to 0/False.
A quick grep ...From https://chat.civicrm.org/civicrm/pl/qxzsdqfjxf8i8cdtq31hdqnpzw and
https://chat.civicrm.org/civicrm/pl/k1pggukwfbdo9fzztjb33pikdo
There looks to be some places where is_current_revsion is still being set to 0/False.
A quick grep suggests the following need attention:
```
CRM/Activity/Page/AJAX.php https://github.com/civicrm/civicrm-core/pull/26091 - merged
CRM/Case/Form/Activity.php https://github.com/civicrm/civicrm-core/pull/26037 - merged
CRM/Case/Form/Activity/ChangeCaseStartDate.php https://github.com/civicrm/civicrm-core/pull/26039 - merged
```https://lab.civicrm.org/dev/core/-/issues/4221SearchKit: calculating average of money value does not result in money2023-09-18T12:49:57ZjmargrafSearchKit: calculating average of money value does not result in moneyOverview
----------------------------------------
We use SearchKit to calculate the average membership contribution.
The input values are in €. In Version 5.50.4 the result was presented as money [in €].
But with an update to Version 5.5...Overview
----------------------------------------
We use SearchKit to calculate the average membership contribution.
The input values are in €. In Version 5.50.4 the result was presented as money [in €].
But with an update to Version 5.58.1 the result is presented as a number instead of as money [in €].
The represenation of the mean value should als be as money [in €].
presentation in 5.50.4:
![mean-value-old](/uploads/9e17c1c2f8ea52b8aad08960fd9faeab/mean-value-old.png)
presentation in 5.58.1:
![mean-value-new](/uploads/22f212e498fe82dd0dac0b6291fc97f2/mean-value-new.png)
Reproduction steps
----------------------------------------
The following SearchKit configuration is used:
![searchkit](/uploads/f6f8ec275d84c34fff59e5edb341f5a0/searchkit.png)
Current behaviour
----------------------------------------
mean value is represented as a value
Expected behaviour
----------------------------------------
mean value should be represented as money [in €]
Environment information
----------------------------------------
* __CiviCRM:__ 5.58.1
* __CMS:__ Drupal 9.4.8https://lab.civicrm.org/dev/core/-/issues/4222Links with null data arguments are not displayed in SearchKit displays2023-05-23T19:59:14Zct_itsupportLinks with null data arguments are not displayed in SearchKit displaysOverview
----------------------------------------
A link item required in a List or Table display item in SearchKit will not be output if any data item or items in the link is/are missing. This issue arises from the following question as...Overview
----------------------------------------
A link item required in a List or Table display item in SearchKit will not be output if any data item or items in the link is/are missing. This issue arises from the following question asked on StackOverflow. See:
[Why are SearchKit links blank if a data item is missing?](https://civicrm.stackexchange.com/q/44750/6361)
Reproduction steps
----------------------------------------
1. Create a simple webform to edit aspects of a case type, ensuring you have more than one contact ID or activity ID update
2. Create a SearchKit search that lists the cases of that type and add a custom link to the webform, passing in the arguments link case ID, contact ID etc
3. Ensure some data is null in a couple of your cases
4. Look at the output of SearchKit links thst have data items missing
Current behaviour
----------------------------------------
A user viewing the SearchKit display will not see links - see screenshot:
![2023-04-06_09_20230405_CiviCRMS_SearchKit_issue_](/uploads/9c589ca3eb272d2066ee4264860fcdcf/2023-04-06_09_20230405_CiviCRMS_SearchKit_issue_.png)
Expected behaviour
----------------------------------------
I believe every link should be output, regardless of the null data. This is the current behaviour of the Drupal Views we use for the same purposes
Environment information
----------------------------------------
<!-- Some of the items below may not be relevant for every bug - if in doubt please include more information than you think is neccessary. -->
__CiviCRM:__ _5.9.3_
__PHP:__ _7.4.3_
__CMS:__ _Drupal 7.95_
__Database:__ _MySQL 5.7.35_
__Web Server:__ _Apache 2.4.38_https://lab.civicrm.org/dev/core/-/issues/4223To edit price sets CiviContribute access needed2023-04-12T07:25:37ZMariaVTo edit price sets CiviContribute access neededOverview
----------------------------------------
A user has limited permissions without access to CiviContribute but has access to CiviEvent and needs to set up price sets. It is possible to view price sets but they can not be edited or...Overview
----------------------------------------
A user has limited permissions without access to CiviContribute but has access to CiviEvent and needs to set up price sets. It is possible to view price sets but they can not be edited or created because of the financial type.
Reproduction steps
----------------------------------------
1. Create price set for Events (with a user without CiviContribute access)
2. Create price field (radio buttons)
3. Add options to this price field
4. Fill all needed information
5. Save
6. Error "financial type is mandatory"
Current behaviour
----------------------------------------
When I open a price set option it shows me this:
![image](/uploads/f5b1e1b6648bb6beb30cf36b3ab2fe7a/image.png)
(Zuwendungsart = financial type)
With administrator this:
![image](/uploads/b6fc64b239dad54bbf4ba68c72434241/image.png)
If I give "CiviContribute access" it works.
Expected behaviour
----------------------------------------
When CiviEvent access is given, users are allowed to create price sets.
Environment information
----------------------------------------
* __CiviCRM:__ _5.58.1
* __CMS:__ _Drupal 7https://lab.civicrm.org/dev/core/-/issues/4224DB error message when creating new campaign with existing "External ID"2023-04-12T07:26:10ZDetlev SieberDB error message when creating new campaign with existing "External ID"Overview
----------------------------------------
When creating a new campaign, an external_id can be added. This external_id must be unique.
However, when a new campaign is entered with an external_id that already exists in the databas...Overview
----------------------------------------
When creating a new campaign, an external_id can be added. This external_id must be unique.
However, when a new campaign is entered with an external_id that already exists in the database, there is no error message giving the chance to enter another external_id, but we receive a database error:
```
Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred.
DB Error: already exists
```
Reproduction steps
----------------------------------------
1. Create a new campaign with External ID "10001"
2. Create another new campaign with another name but with the same External ID "10001"
3. Database error is displayed, leaving thu user puzzled.
Current behaviour
----------------------------------------
Database error, that gives the user no clue what happened.
Expected behaviour
----------------------------------------
There should be a message stating "External ID already exists", giving the user the chance to enter another external ID (or leave the field empty).
Environment information
----------------------------------------
* __CiviCRM:_Master/5.59.xhttps://lab.civicrm.org/dev/core/-/issues/4226Mapping.mapping_id does not resolve in api v4 explorer2023-04-12T07:28:35ZeileenMapping.mapping_id does not resolve in api v4 explorer@colemanw what is the right approach here - there is a foreign key - but civicrm_mapping only has name, not label etc -(I kinda see this table being deprecated over time too)
![image](/uploads/618ea8286b9b6792ccad8de319ff311f/image.png)...@colemanw what is the right approach here - there is a foreign key - but civicrm_mapping only has name, not label etc -(I kinda see this table being deprecated over time too)
![image](/uploads/618ea8286b9b6792ccad8de319ff311f/image.png)
```
<field>
<name>mapping_id</name>
<type>int unsigned</type>
<title>Mapping ID</title>
<required>true</required>
<comment>Mapping to which this field belongs</comment>
<html>
<label>Mapping</label>
</html>
<add>1.2</add>
</field>
<foreignKey>
<name>mapping_id</name>
<table>civicrm_mapping</table>
<key>id</key>
<add>1.2</add>
<onDelete>CASCADE</onDelete>
</foreignKey>
```https://lab.civicrm.org/dev/core/-/issues/4230Some times custom fields data are set from wrong contact2023-04-12T07:30:30ZPradeep Nayakpradpnayak@gmail.comSome times custom fields data are set from wrong contactOn membership signup form on page load by default custom field are set with wrong data i.e from a different contact. This has raised big concern for our clients as their confidential data are exposed to others.
This happens when the mem...On membership signup form on page load by default custom field are set with wrong data i.e from a different contact. This has raised big concern for our clients as their confidential data are exposed to others.
This happens when the membership id for the [contact is used as contact id to fetch the detail](https://github.com/civicrm/civicrm-core/blob/master/CRM/Contribute/Form/Contribution/Main.php#L285)s.
Steps to replicate on dmaster:
1. Create a custom field for a contact, add to profile and include the profile on membership signup/renewal form.
2. [Find membership](https://dmaster.demo.civicrm.org/civicrm/member/search?reset=1)
3. Look for any contact Smith, Rodrigo. Check for contact id and membership id for the contact. For now the cid=75 and mid=11
4. Edit the contact cid=11 and update the custom field created at step 1.
5. visit the membership renewal/signup form for cid=75 https://dmaster.demo.civicrm.org/civicrm/contribute/transact?cid=75&reset=1&id=2
Actual result:
Custom field is populated for cid=11 instead cid=75
Expected result:
Custom field is populated for cid=75https://lab.civicrm.org/dev/core/-/issues/4231Contact Import will not accept State/Province outside the Default Country2023-12-13T20:08:15ZStoobContact Import will not accept State/Province outside the Default CountryTo reproduce on dmaster
1. within [Localization Settings](https://dmaster.demo.civicrm.org/civicrm/admin/setting/localization?reset=1)
a. set default country to United States
b. Ensure that for Available Countries box on the right i...To reproduce on dmaster
1. within [Localization Settings](https://dmaster.demo.civicrm.org/civicrm/admin/setting/localization?reset=1)
a. set default country to United States
b. Ensure that for Available Countries box on the right is blank in such that all countries are available for selection
2. go to Import Contacts
3. attempt import a file such as the one attached below that contains Country as a mapped column
4. note that Canada (and presumably another non-default) country is deemed invalid in the error report
[test-country.csv](/uploads/fb97a20935d51e0b9c72530fa12d663b/test-country.csv)
![import-errors-canada_province](/uploads/0b647875367fc261ff6a8fb134595d98/import-errors-canada_province.jpg)https://lab.civicrm.org/dev/core/-/issues/4232Improve FormBuilder handling of non logged in flows2023-08-29T16:49:11ZMichael McAndrewImprove FormBuilder handling of non logged in flowsWe've been working with a few clients on forms that should be available to the outside world / logged out users and want to suggest some improvements to Form Builder to cater to these scenarios.
They revolve around a couple of workflows...We've been working with a few clients on forms that should be available to the outside world / logged out users and want to suggest some improvements to Form Builder to cater to these scenarios.
They revolve around a couple of workflows.
1. Require email confirmation **to view a form**.
2. Require email confirmation **to process a form**
We plan on adding an 'Anonymous users' setting to the FormBuilder settings to support this. It will be a select that allows people to choose between the above two options.
### Require email confirmation **to view a form**
We're using this to make a 'Communication preferences' form available to non logged in users 'on demand'.
When a non logged in user visits https://example.org/civicrm/communication-preferences, they will see an email field and a message along the lines of "Enter your email below and if your email exists in our system we will send you a link to the 'Communication preferences' page".
We only send an email if the email already exists in CiviCRM. If it does not, we silently ignore it. Clicking on the checksum link will authenticate them and send them back to the same form.
This is similar in nature to the traditional checksum workflow.
### Require email confirmation **to process a form**
We're using this, for example, to provide 'double opt in' functionality to newsletter sign up forms. And also to get users to confirm any changes to their email address.
It probably make sense to make this option configurable so it can be set
- for just logged out users
- for logged out users *and* logged in users if the email has changed
We think we can implement this by adding an early event listener that logs the submission, sends an email to the user asking them to confirm their email address (using the email submitted in the form) and stops the event propagation *before any entities are updated*.
If and when the person confirms their email by clicking a link in the email we restart the processing by dispatching the event again with the submitted data and update entities as necessary.
### More thoughts
Both these measures act as a form of spam protection. Unlike the current double opt in which creates a contact before the email is confirmed (with a pending subscription), in the Require email confirmation **to process a form** flow, no contact is created until the email is confirmed. This should result in less spam contacts ending up in CiviCRM.
Require email confirmation **to process a form** probably won't play nicely with file attachments out of the box (and we think that is OK for a v1).
Not sure if Require email confirmation **to process a form** would make sense on a form that is doing financial transactions but we're treating that as out of scope for now (seems fine since you can't use form builder to process transactions right now any way!)
Require email confirmation **to process a form** is a subset of a wider workflow which is require confirmation to process a form, e.g. confirmation from staff that an update to a member profile is acceptable before being published on a website.
If we're lucky, we might be able to implement all of this an an extension but at the same time, it feels quite core and would be up for adding it to core if preferred.
***Your thoughts and feedback how we can improve this proposal and any potential issues very welcome!***Kurund JalmiKurund Jalmihttps://lab.civicrm.org/dev/core/-/issues/4234Change Dedupe Rule Usage Dialog Is Not Displayed2023-05-15T08:23:09ZLKuttnerChange Dedupe Rule Usage Dialog Is Not DisplayedReproduction steps
1. Go to Find and Merge Duplicate Contacts
2. Click _Edit Rule_ for a General Unreserved rule.
3. In Usage: Currently set to: click the _Change Usage_ button which is NOT disabled.
Current behaviour
The Change Usage ...Reproduction steps
1. Go to Find and Merge Duplicate Contacts
2. Click _Edit Rule_ for a General Unreserved rule.
3. In Usage: Currently set to: click the _Change Usage_ button which is NOT disabled.
Current behaviour
The Change Usage dialog does not appear and nothing at all happens.
Expected behaviour
The Change Usage dialog appears and the rule can be set as Supervised or Unsupervised.
Environment information
- CiviCRM 5.50.4
- Drupal 9.3.13
- PHP 7.4.19https://lab.civicrm.org/dev/core/-/issues/4235Simplify cron setup2023-04-18T20:10:24Zaydunsaidan.saunders@squiffle.ukSimplify cron setupOverview
----------------------------------------
A recurring problem for new users is how to get cron running for scheduled jobs.
We have documentation but it's still a stumbling block for many new users as shown by recurring questions...Overview
----------------------------------------
A recurring problem for new users is how to get cron running for scheduled jobs.
We have documentation but it's still a stumbling block for many new users as shown by recurring questions on Stack Exchange and chat, and (just now) discussed on the FormBuilder call.
Part of the problem is that it involves the OS and/or the hosting platform (cPanel etc) and we generally shy away from documenting anything in those areas but the collective brains of the Civi world surely can come up a way to make this work more easily.
Advanced users can obviously do their own thing, but the aim here is to lower the barrier for new installations to having a functioning cron.https://lab.civicrm.org/dev/core/-/issues/4237Count is inacurate in Find and Merge Duplicates2024-02-27T01:12:33ZStoobCount is inacurate in Find and Merge DuplicatesIn the attached example has only 800 contacts in the entire Civi although the same person has **several _dozen_ duplicates of themselves**, for whatever reason. The side effect is what appears to be an exponentially inaccurate duplicate ...In the attached example has only 800 contacts in the entire Civi although the same person has **several _dozen_ duplicates of themselves**, for whatever reason. The side effect is what appears to be an exponentially inaccurate duplicate count as well as in the batch merge screen.
![du](/uploads/c74e365a75d2fe01fcca2c39f07b1579/du.png)
![batcha](/uploads/46f2a517bbabadbd953c9b8c7e05661e/batcha.png)https://lab.civicrm.org/dev/core/-/issues/4241Refresh custom fields names in "Reuse an existing set"2023-04-18T06:50:39ZkristinecRefresh custom fields names in "Reuse an existing set"Overview
----------------------------------------
When adding a new custom field and selecting "reuse an existing set" of custom fields, the dropdown list for some of the multiple choice option sets do not pick up the custom field set na...Overview
----------------------------------------
When adding a new custom field and selecting "reuse an existing set" of custom fields, the dropdown list for some of the multiple choice option sets do not pick up the custom field set names. For example, you have a multiple choice question called "Educational Status" in Custom Field Set A and the same name "Educational Status" in Custom Field B.
Current behaviour
----------------------------------------
In CiviCRM 5.59, the custom field set labeling are missing for some old custom fields (made before a certain Civi update?).
![Screenshot_2023-04-15_111421](/uploads/dc83d16e1c6fcf8a2e9cce1961260909/Screenshot_2023-04-15_111421.png)
Proposed behaviour
----------------------------------------
The word "refresh" or "reset" the dropdown list probably isn't the right word. But the expected behavior should appear as:
Custom Field Set A:: Educational Status
Custom Field Set B:: Educational Status
P.S. And yes, technically if the options in "Educational Status" are exactly the same, this field set should have been shared rather than exist in two separate custom field sets.https://lab.civicrm.org/dev/core/-/issues/4243Support APCu with apcu_* functions2023-04-18T17:34:00ZherbdoolSupport APCu with apcu_* functionsAPC and APCu is supported according to https://docs.civicrm.org/sysadmin/en/latest/setup/cache/#config-ref but it currently only supports `apc_*` functions which are ~~backwards-compatible with~~ _not compatible_ with APC. ~~But some set...APC and APCu is supported according to https://docs.civicrm.org/sysadmin/en/latest/setup/cache/#config-ref but it currently only supports `apc_*` functions which are ~~backwards-compatible with~~ _not compatible_ with APC. ~~But some setups may only have the newer `apcu_*` functions so the class should try both functions.~~ APCu only has `apcu_*` functions, but still uses `apc.` for the configuration.
UPDATE: discovered there are some differences between the two in how they handle things, which isn't surprising. So depending on how much they differ, may require different classes.https://lab.civicrm.org/dev/core/-/issues/4244"Invoice.pdf" filename not translatable2023-04-18T06:49:02Zmmyriam"Invoice.pdf" filename not translatableWhen "Automatically email invoice when user purchases online" is enabled in CiviContribute Component Settings a pdf invoice is sent to the user who makes an online contribution.
The attached invoice's filename is not translated/translat...When "Automatically email invoice when user purchases online" is enabled in CiviContribute Component Settings a pdf invoice is sent to the user who makes an online contribution.
The attached invoice's filename is not translated/translatable from Invoice.pdf because it is hardcoded:
https://github.com/civicrm/civicrm-core/blob/master/CRM/Contribute/Form/Task/Invoice.php#L613
```
public static function putFile($html, $name = 'Invoice.pdf', $format = NULL) {
return CRM_Utils_Mail::appendPDF($name, $html, $format)['fullPath'] ?? '';
}
```
The `putFile` function allows for a filename for when the invoice is sent by an admin from the contribution record.
In that case the invoice gets its name from the contribution invoice number which is created using the invoice prefix configured in CiviContribute Component Settings: https://github.com/civicrm/civicrm-core/blob/master/CRM/Contribute/Form/Task/Invoice.php#L434
Reproduction steps
----------------------------------------
1. Enable "Automatically email invoice when user purchases online" in CiviContribute Component Settings
1. Make an online contribution on a contribution form
* where the receipt is enabled
* in a different language than English
1. Receive an email with Invoice.pdf attachedhttps://lab.civicrm.org/dev/core/-/issues/4245FormBuilder/SearchKit: add 'enabled' field2023-04-20T06:55:21Zaydunsaidan.saunders@squiffle.ukFormBuilder/SearchKit: add 'enabled' fieldOverview
----------------------------------------
Suggestion: add an 'enabled' field for both Searches and Forms (maybe Segments and related entities as well).
Why?: quite often I clone something, make some changes, switch to that - but...Overview
----------------------------------------
Suggestion: add an 'enabled' field for both Searches and Forms (maybe Segments and related entities as well).
Why?: quite often I clone something, make some changes, switch to that - but don't want to delete the original yet until I'm sure I don't want to revert to it. Marking it as 'not enabled' helps search & form management particularly as the numbers increase.https://lab.civicrm.org/dev/core/-/issues/4246FormBuilder Recaptcha ignored in CiviCase Form2023-04-20T06:54:55ZshaneonabikeFormBuilder Recaptcha ignored in CiviCase FormOverview
----------------------------------------
When creating a Afform CiviCase form volunteer form it seems to ignore whether the actual Recaptcha is completed. There is an error being thrown in the logs, but the form continues and i...Overview
----------------------------------------
When creating a Afform CiviCase form volunteer form it seems to ignore whether the actual Recaptcha is completed. There is an error being thrown in the logs, but the form continues and is redrected to the Post-Submit page.
+ Create a Form with Individual and Case
+ Add Custom Fields associated to Individual and set Autofill on Current User
+ Set Case Type to ```Volunteer Application``` and Status ```New Request```
+ Set permissions on Case to ```Open Access``` and ```Create```
+ Set permissions on Individual to ```Open Access``` and ```Create and Update```
+ No deduping
Here's the actual Markup I have
```html
<af-form ctrl="afform">
<af-entity data="{contact_type: 'Individual', source: 'Volunteer Application'}" type="Contact" name="Individual1" label="Individual 1" actions="{create: true, update: true}" security="FBAC" autofill="user" contact-dedupe="" />
<af-entity data="{contact_id: 'Individual1', case_type_id: '3', subject: 'Request Form - Volunteer Application', status_id: '4'}" actions="{create: true, update: false}" type="Case" name="Case1" label="Case 1" security="FBAC" />
<div class="af-markup">
<p>If you don't have the necessary documents or would like to know more about any of our policies or processes, please contact the office.</p>
</div>
<fieldset af-fieldset="Individual1" class="af-container" af-title="Your details">
<div class="af-container af-layout-cols">
<af-field name="first_name" defn="{required: true, input_attrs: {}}" />
<af-field name="last_name" defn="{required: true, input_attrs: {}}" />
</div>
<fieldset af-join="Email">
<div class="af-container af-layout-cols">
<af-field name="email" />
<af-field name="location_type_id" />
<af-field name="is_primary" defn="{afform_default: '1'}" />
</div>
</fieldset>
<div af-join="Phone" af-repeat="Add" min="2" max="2">
<fieldset class="af-container af-layout-inline">
<af-field name="phone" defn="{required: false, input_attrs: {}}" />
<af-field name="location_type_id" defn="{required: false, input_attrs: {}}" />
<af-field name="phone_type_id" />
</fieldset>
</div>
<div af-join="Address">
<div class="af-container">
<af-field name="street_address" />
</div>
<div class="af-container af-layout-cols">
<af-field name="city" />
<af-field name="state_province_id" />
<af-field name="country_id" />
<af-field name="postal_code" />
<af-field name="location_type_id" defn="{label: 'Address Location', input_attrs: {}, required: false}" />
</div>
</div>
<div class="af-container af-layout-cols" af-title="Your interests and skills">
<af-field name="Volunteer_Details.Interests" defn="{label: 'Interests', required: true}" />
<af-field name="Volunteer_Details.Your_Skills" defn="{label: 'Abilities / Skills / Experience', required: true}" />
</div>
<div id="check" class="af-container" af-title="Police Information Check (PIC) is required for this position">
<div class="af-markup">
<p>markup</p>
</div>
<af-field name="Volunteer_Details.Police_Check" defn="{label: false}" />
</div>
<div id="driver" class="af-container af-layout-cols" af-title="Additional Required Information">
<af-field name="Volunteer_Details.Driver_s_License" defn="{label: 'Your Driver\'s License'}" />
<af-field name="Volunteer_Details.Driver_Insurance" defn="{label: 'Your Car Insurance'}" />
</div>
<div class="af-container" af-title="Availability">
<af-field name="Availability.Days_of_Week" defn="{required: true, label: 'Available Days of Week'}" />
<div class="af-container">
<af-field name="Availability.Location_willing_to_volunteer" defn="{required: true, label: 'What location are you willing to volunteer at?'}" />
<af-field name="Availability.Choose_a_depot" defn="{input_attrs: {autoOpen: true}, label: 'Choose a depot that you are hoping to volunteer at', required: true, saved_search: 'All_Depots', security: 'FBAC'}" />
</div>
<div id="outreach" af-join="Custom_Outreach">
<af-field name="How_did_you_hear_about_us_" defn="{label: 'How did you hear about us?', help_pre: 'Let us know how you heard about us.', help_post: null}" />
</div>
<div class="af-container" af-title="Privacy of our Members">
<af-field name="Volunteer_Details.Consent_to_confidentiality_of_member_and_organizational_informat" defn="{label: 'Do you consent to maintaining the confidentiality of members and organizational information?', required: true}" />
</div>
</div>
</fieldset>
<fieldset af-fieldset="Case1" class="af-container">
<af-field name="details" defn="{label: 'Tell us a little bit about yourself'}" />
<crm-recaptcha2></crm-recaptcha2>
<button class="af-button btn btn-primary" crm-icon="fa-check" ng-click="afform.submit()">Send Application</button>
</fieldset>
</af-form>
```
I don't think that this is a related problem to configuration of ```AuthX```, but if you need a screenshot of the permissions I set I can do that too.
Current behaviour
----------------------------------------
The submission goes directly to the Post-Submit page, and no actual entry is made for CiviCase.
The logs produce
```php
Apr 18 11:20:49 [debug] AJAX Error ({error_id}): failed with exception
Array
(
[error_id] => uJNn-04Ej-YDUq
[exception] => CRM_Core_Exception: "Validation Error"
#0 /var/aegir/platforms/wordpress/wp-content/plugins/civicrm/civicrm/ext/afform/core/Civi/Api4/Action/Afform/AbstractProcessor.php(74): Civi\Api4\Action\Afform\Submit->processForm()
#1 /var/aegir/platforms/wordpress/wp-content/plugins/civicrm/civicrm/Civi/Api4/Provider/ActionObjectProvider.php(72): Civi\Api4\Action\Afform\AbstractProcessor->_run()
#2 /var/aegir/platforms/wordpress/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(158): Civi\Api4\Provider\ActionObjectProvider->invoke()
#3 /var/aegir/platforms/wordpress/wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/AbstractAction.php(250): Civi\API\Kernel->runRequest()
#4 /var/aegir/platforms/wordpress/wp-content/plugins/civicrm/civicrm/api/api.php(85): Civi\Api4\Generic\AbstractAction->execute()
#5 /var/aegir/platforms/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Api4/Page/AJAX.php(138): civicrm_api4()
#6 /var/aegir/platforms/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Api4/Page/AJAX.php(79): CRM_Api4_Page_AJAX->execute()
#7 /var/aegir/platforms/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(319): CRM_Api4_Page_AJAX->run()
#8 /var/aegir/platforms/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(69): CRM_Core_Invoke::runItem()
#9 /var/aegir/platforms/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke()
#10 /var/aegir/platforms/wordpress/wp-content/plugins/civicrm/civicrm.php(1199): CRM_Core_Invoke::invoke()
#11 /var/aegir/platforms/wordpress/wp-includes/class-wp-hook.php(308): CiviCRM_For_WordPress->invoke()
#12 /var/aegir/platforms/wordpress/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
#13 /var/aegir/platforms/wordpress/wp-includes/plugin.php(565): WP_Hook->do_action()
#14 /var/aegir/platforms/wordpress/wp-includes/class-wp.php(797): do_action_ref_array()
#15 /var/aegir/platforms/wordpress/wp-includes/functions.php(1334): WP->main()
#16 /var/aegir/platforms/wordpress/wp-blog-header.php(16): wp()
#17 /var/aegir/platforms/wordpress/index.php(17): require("/var/aegir/platforms/wordpress/wp-blog-header.php")
#18 {main}
)
```
Expected behaviour
----------------------------------------
The form would not allow me to passthrough and would display an error message.https://lab.civicrm.org/dev/core/-/issues/4250Expose the mailing/mosaico template when viewing mailing report2023-06-19T23:42:32ZyashodhaExpose the mailing/mosaico template when viewing mailing reportCurrently, we don't show which mosaico template was used for a mailing in mailing reports.
It could be helpful as sometimes the template could be deleted and when the same mailing is re-used then mosaico is broken in the copied mailing....Currently, we don't show which mosaico template was used for a mailing in mailing reports.
It could be helpful as sometimes the template could be deleted and when the same mailing is re-used then mosaico is broken in the copied mailing. We could show name/id and deleted if not present.https://lab.civicrm.org/dev/core/-/issues/4251Track Contact `image_URL` files in the `civicrm_file` table2024-01-02T21:02:33ZcolemanwTrack Contact `image_URL` files in the `civicrm_file` table# History
**Note: CiviCRM is a large, old project with many contributors, which makes "big picture" perspectives cumbersome to gather. Often a contributor simply wants to fix a bug or add a small feature, not dive into decades-long hist...# History
**Note: CiviCRM is a large, old project with many contributors, which makes "big picture" perspectives cumbersome to gather. Often a contributor simply wants to fix a bug or add a small feature, not dive into decades-long history and contemplate massive refactoring. The story of the `civicrm_contact.image_URL` field is a microcosm of the complicated world of CiviCRM.**
- The `civicrm_contact.image_URL` field (added v1.1) predates the `civicrm_file` table (added v1.5), which may explain why it was originally designed as a simple textfield with no file-management. It is a simple varchar and can store the url to any image file on the web.
- Originally, the UI allowed contact image files to be uploaded to a publicly-readable directory on the webserver, and `image_URL` stored an absolute url to that file.
- In 2014, [security hardening](https://issues.civicrm.org/jira/browse/CRM-14499) led to the addition of an `.htaccess` rule which blocked the contents of that directory from public visibility.
- This accidentally broke contact images, leading to [a rushed fix](https://github.com/civicrm/civicrm-core/pull/3058) which created `CRM_Contact_Page_ImageFile` at `civicrm/contact/imagefile`. This path allows open access to all contact images, but not other files, by querying `civicrm_contact.image_URL` for a matching filename before outputting the contents. An upgrade script rewrote all local `image_URL` fields to point to this path, using an absolute URL. This solution works but is very slow on big databases due to the unindexed query.
- During this rushed fix, it doesn't appear that consideration was given to html escaping of `&` characters. The default behavior of `CRM_Utils_System::url` is to escape `&` to `&` which is (IMHO) a bad default and certainly a poor choice for storing url strings in the database, but it was the default and no one changed it, and then Tim inadvertently cemented it with 065034510d48b722844b2007f8016ea644bd0cbd so now in order to safely read the urls you must pass them through the aptly-named `CRM_Utils_String::unstupifyUrl()` function.
- In 2016 there was an [attempt to fix the absolute URL and performance issues](https://github.com/civicrm/civicrm-core/pull/9237) which updated all the `image_URL` fields to relative paths.
- But this would have broken Drupal Views and other tools that rely on the convenience of querying the field from the db and outputting the url directly (in the future, SearchKit would rely on this too).
- A [compromise solution was reached](https://github.com/civicrm/civicrm-core/pull/9241) which rewrites the url at runtime on Civi pages. A `image_URL` like `http://wp.demo/civicrm/contact/imagefile/?photo=abc.jpeg` would get rewritten to `http://wp.demo/civicrm/file?reset=1&filename=abc.jpeg&mime-type=image/jpeg`. For reasons not entirely clear, this goes through a different internal path (`civicrm/file` instead of `civicrm/contact/imagefile`).
- In 2019, thinking it was unused, [Eileen removed support](https://github.com/civicrm/civicrm-core/commit/2762985c11e01ede473d86a33af279bc341f9a46) for passing `filename=` into the `civicrm/file` path, since that endpoint is typically supplied with a file id from the `civicrm_file` table plus a security hash.
- This accidentally broke contact images, leading to [a rushed fix](https://github.com/civicrm/civicrm-core/pull/13663) which added back the ability to get files by name from the `civicrm/file` path (since contact images are not tracked in `civicrm_file` and don't have an `id`). With the benefit of the history laid out above, a better fix might have been to switch to using the `civicrm/contact/imagefile` path and keep the `civicrm/file` path secure.
- In 2021 [I proposed adding](https://lab.civicrm.org/dev/core/-/issues/2755) an `image_file_id` FK field to the `civicrm_contact` table to track uploaded files. This proposal was met with approval, but when I recently tried to implement it I realized that the `civicrm_file` table already has an FK to `civicrm_contact` and circular references are not allowed.
- In 2023 [an option group was added](https://github.com/civicrm/civicrm-core/pull/25904) for the previously unused column `civicrm_file.file_type_id`. One possible use for that field would be to designate a file type of `"contact_image"`.
# Current Situation
The `civicrm_contact.image_URL` field can still store any url string pointing to a file on or off the server. It could point to any image on the internet, and would work fine. But if it's a file uploaded via the Civi UI, it will be an absolute link pointing to the `civicrm/contact/imagefile` path with a `photo=filename` argument. If CiviCRM recognizes this pattern it will rewrite it on core pages to the other path at `civicrm/file`, otherwise it will leave it alone.
For the confused, yes contact images are accessible at two paths, and neither is a direct link to the file on disk:
| Path | `civicrm/contact/imagefile` | `civicrm/file` |
| ------ | ------ | ------ |
| Class | `CRM_Contact_Page_ImageFile` | `CRM_Core_Page_File` |
| Permission | _none_ | "access uploaded files" |
| Args | `photo` | `filename`, `mime-type` |
| Uses | Stored in `image_URL` field as absolute URL. Output by Views & SearchKit | `image_URL` rewritten to this path on Civi pages for logged-in users |
**This situation leads to the following quirks and problems**
1. The absolute url to `civicrm/contact/imagefile` works great in Views and SearchKit... as long as the site name never changes! Otherwise, absolute URLs are a pain.
2. The url is still stored with html-escaped `&` characters that must be unstupified.
3. Anyone can access a contact image via the 1st path if they know the filename, however, the 2nd has a permission check which means logged-in users without "access uploaded files" cannot see contact images even though anonymous users can!
4. The security hash usually required by `civicrm/file` can be circumvented if you know the filename and mime-type. But the risk is mitigated by that path requiring "access uploaded files" permission.
5. There is still no file-management of contact images. Deleting a contact does not delete their image file. Deleting or changing a contact image also doesn't delete the old one.
# Proposal for File Management
1. Stop using `civicrm/file` for all contact images and [restore the patch to remove support for `filename`](https://github.com/civicrm/civicrm-core/commit/2762985c11e01ede473d86a33af279bc341f9a46).
2. Include `cid` as an argument to `civicrm/contact/imagefile` (and update stored paths accordingly) to fix the unindexed query. Also add `is_deleted = 0` to the query.
3. Add an option_value `"contact_image"` to the option group for `civicrm_file.file_type_id`.
4. When uploading a new contact image, create a record in `civicrm_file` table, and designate it `file_type_id` = `"contact_image"`.
5. Also create a record in `civicrm_entity_file` for contact images.
6. Add a virtual APIv4 field for the contact entity `image_file_id` which would allow getting/setting the file id. When setting a new file id, regenerate the `image_URL` with a post hook.
# Thoughts on Absolute URLs
All of these changes would result in better file management, but still doesn't solve the absolute url issue. This is tricky to solve because Views and SearchKit still rely on being able to output the image url directly from a query. Here are a few ideas for that one:
1. Bite the bullet and update all `image_URL` fields pointing to a local file to use a relative URL. SearchKit will still work. Views and other SQL-based tools will still work unless embedded on a remote site. Random offsite images will be unaffected.
2. Keep `image_URL` absolute but add an APIv4 virtual field like `Contact.image` which calculates the url at runtime. This satisfies moree use-cases but at the expense of adding complexity to an already overcomplicated situation.https://lab.civicrm.org/dev/core/-/issues/4252Add a filter to mailing search/report to check if the mailing is mosaico or t...2023-05-01T07:38:30ZyashodhaAdd a filter to mailing search/report to check if the mailing is mosaico or traditionalAdd a filter to mailing search/report to check if the mailing is mosaico or traditional.
It might be useful to indicate the same next to result of mailing search -draft mailings, sent mailings.Add a filter to mailing search/report to check if the mailing is mosaico or traditional.
It might be useful to indicate the same next to result of mailing search -draft mailings, sent mailings.yashodhayashodhahttps://lab.civicrm.org/dev/core/-/issues/4253cURL error when trying to update action-provider, data processor or CiviRules...2024-01-21T12:44:06ZMariaVcURL error when trying to update action-provider, data processor or CiviRules via UIOverview
----------------------------------------
When trying to update action provider or data processor via UI the following error occurs:
`(cURL error 28: Operation timed out after 5000 milliseconds with 142514 out of 408357 bytes rec...Overview
----------------------------------------
When trying to update action provider or data processor via UI the following error occurs:
`(cURL error 28: Operation timed out after 5000 milliseconds with 142514 out of 408357 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)`
Reproduction steps
----------------------------------------
1. Click on _Extensions_
2. Upgrade action-provider or data processor or CiviRules
3. Error (see above)
Current behaviour
----------------------------------------
Using wget via terminal the download for action provider takes 15 seconds.
Data processor download takes 1m 52s via wget.
It seems that lab.civicrm.org is quite slow.
Expected behaviour
----------------------------------------
Successful Update via UI
Possible solution: time out increasehttps://lab.civicrm.org/dev/core/-/issues/4255AdminUI breadcrumb links are confusing and unhelpful2023-05-02T07:14:25ZlarsssandergreenAdminUI breadcrumb links are confusing and unhelpfulOverview
----------------------------------------
The breadcrumb links for AdminUI pages are incorrect and confusing for users.
Current behaviour
----------------------------------------
For example for profile fields, the breadcrumb li...Overview
----------------------------------------
The breadcrumb links for AdminUI pages are incorrect and confusing for users.
Current behaviour
----------------------------------------
For example for profile fields, the breadcrumb links are:
`Home › CiviCRM › Admin › FormBuilder › Edit Form › Profile Fields`
If a user clicks the breadcrumb link for Profile Fields, they get all profile fields for all profiles, not just the profile fields for their profile. They also cannot go back to the main profiles page or the settings for the profile they are editing the fields for.
This is the same for custom fields and other AdminUI pages.
Expected behaviour
----------------------------------------
The breadcrumb links should be:
`Home › CiviCRM › Admin › Profiles › PROFILENAME › Profile Fields`
Clicking the breadcrumb links should lead to the expected pages.
Environment information
----------------------------------------
dmasterhttps://lab.civicrm.org/dev/core/-/issues/4256SearchKit: Does not list activities correctly on Contact Summary2023-06-30T10:16:22ZKurund JalmiSearchKit: Does not list activities correctly on Contact SummaryCreate a SK display to replace existing Activity tab.
![Screenshot_from_2023-04-22_17-46-25](/uploads/682c4d5e851ddcde05a825a286be6435/Screenshot_from_2023-04-22_17-46-25.png)
Activity Tab (SK) does not display activities.
![Screenshot...Create a SK display to replace existing Activity tab.
![Screenshot_from_2023-04-22_17-46-25](/uploads/682c4d5e851ddcde05a825a286be6435/Screenshot_from_2023-04-22_17-46-25.png)
Activity Tab (SK) does not display activities.
![Screenshot_from_2023-04-22_17-48-50](/uploads/28ef32556946fcc40b959a1fc507940e/Screenshot_from_2023-04-22_17-48-50.png)
Here is default Activity Tab
![Screenshot_from_2023-04-22_17-48-27](/uploads/5a7bb144c255c7461fa18eca54908eb8/Screenshot_from_2023-04-22_17-48-27.png)
I am checking this on master.https://lab.civicrm.org/dev/core/-/issues/4257Allow editing of payment method on contribution edit form when no payments ar...2023-05-30T22:23:24ZlarsssandergreenAllow editing of payment method on contribution edit form when no payments are associatedCurrently, the contribution edit form does not allow editing of the payment method for a pending contribution. This may be useful for users, for example if someone fills out a contribution page with pay later and so their contribution pa...Currently, the contribution edit form does not allow editing of the payment method for a pending contribution. This may be useful for users, for example if someone fills out a contribution page with pay later and so their contribution payment method is set to check, but they will actually pay with an etransfer and we want to note this. It is also potentially confusing because the user can mark the payment as completed and record the payment two ways, by clicking Record Payment or by changing the status to completed, but only the first of these allows the user to change the payment method.
I think we can safely allow editing of the payment method when there are no payments associated with a contribution.https://lab.civicrm.org/dev/core/-/issues/4261Membership Detail Report Date Recieved Value is Incorrect2023-05-01T07:55:40ZAlanDixonMembership Detail Report Date Recieved Value is IncorrectOverview
----------------------------------------
The Membership Detail report (CRM_Report_Form_Member_Detail) reports about the oldest contribution when there are multiple contributions associated with a membership.
Current behaviour
-...Overview
----------------------------------------
The Membership Detail report (CRM_Report_Form_Member_Detail) reports about the oldest contribution when there are multiple contributions associated with a membership.
Current behaviour
----------------------------------------
The sql that selects the contribution associated with the membership uses a simple left join which will select the oldest contribution towards that membership (or at least, the one with the lowest id, which is usually the oldest one).
That contribution information is not as useful as the most recent contribution associated with a membership.
Expected behaviour
----------------------------------------
I would expect to be reporting on the most recent contribution associated with a membership!
Comments
----------------------------------------
Here's where the SQL is getting added:
https://github.com/civicrm/civicrm-core/blob/d4780a599def82852c30bb0475f2e34370932683/CRM/Report/Form/Member/Detail.php#L296
PR forthcoming.https://lab.civicrm.org/dev/core/-/issues/4264SearchKit - can't filter by contribution ID2023-05-01T07:58:16ZeileenSearchKit - can't filter by contribution IDI can't just put contribution id into the WHERE cos it wants to find it...
![image](/uploads/2352f471b29d62632d07cf9f42a61aa8/image.png)
I found it like this
![image](/uploads/55aca8045c154588dc459bc6b8322f0b/image.png)I can't just put contribution id into the WHERE cos it wants to find it...
![image](/uploads/2352f471b29d62632d07cf9f42a61aa8/image.png)
I found it like this
![image](/uploads/55aca8045c154588dc459bc6b8322f0b/image.png)https://lab.civicrm.org/dev/core/-/issues/4265Checksum sent to Organization will not fill in "on behalf of" profile fields2023-11-23T07:47:01ZStoobChecksum sent to Organization will not fill in "on behalf of" profile fieldsScope the different [checksum token](https://docs.civicrm.org/user/en/latest/common-workflows/tokens-and-mail-merge/) behavior 'on behalf of' Org contribution page for
- an Individual related to an Organization https://civiteacher.com/c...Scope the different [checksum token](https://docs.civicrm.org/user/en/latest/common-workflows/tokens-and-mail-merge/) behavior 'on behalf of' Org contribution page for
- an Individual related to an Organization https://civiteacher.com/civicrm/contribute/transact?reset=1&id=9&cs=e8ecaad83d04439f381e4f2bf35d9322_1682576643_504&cid=102&mid=
- that Organization itself https://civiteacher.com/civicrm/contribute/transact?reset=1&id=9&cs=45ce7efc7d44ed07e8fd4097357ddc74_1682576099_504&cid=112&mid= with no contact info in org profile yet placing the org email in the individual email field
Should it not be the case that a checksum sent to an organization should fill out the 'on behalf of' section and leave the individual contact info blank to be filled out later? There are two good use cases where this may occur:
1. emails sent to the primary member organization _and_ the related contact individual(s) for maximum chance of renewal and/or in case contact person has quit
2. the organization primary member does not have a related contact indvidual at all. maybe it was entered incomplete or org imported without contact individual
But I cannot tell if it is a regression or if it has always been this way. @AllenShaw thoughts?https://lab.civicrm.org/dev/core/-/issues/4266Add hook to manipulate activity rows2023-05-01T08:00:13ZyashodhaAdd hook to manipulate activity rowsAdd hook to manipulate activity rowsAdd hook to manipulate activity rowsyashodhayashodhahttps://lab.civicrm.org/dev/core/-/issues/4267The dreaded afform scanner not found2023-05-01T08:02:42ZeileenThe dreaded afform scanner not foundFor some reason I thought we had gotten rid of this error but I just hit it on upgrading a live site (with warm caches) from php 5.60beta to 5.60.0
@totten can you remember the deal here - I think it's the cached container that causes t...For some reason I thought we had gotten rid of this error but I just hit it on upgrading a live site (with warm caches) from php 5.60beta to 5.60.0
@totten can you remember the deal here - I think it's the cached container that causes the problem?
[Error: Finish core DB updates 5.60.0]
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: "You have requested a non-existent service "afform_scanner"."
#0 /srv/www/mysite/wp-content/plugins/civicrm/civicrm/vendor/symfony/dependency-injection/ContainerBuilder.php(600): Symfony\Component\DependencyInjection\ContainerBuilder->getDefinition()
#1 /srv/www/mysite/wp-content/plugins/civicrm/civicrm/vendor/symfony/dependency-injection/ContainerBuilder.php(558): Symfony\Component\DependencyInjection\ContainerBuilder->doGet()
#2 /srv/www/mysite/wp-content/plugins/civicrm/civicrm/Civi.php(175): Symfony\Component\DependencyInjection\ContainerBuilder->get()
#3 /srv/www/mysite/wp-content/plugins/civicrm/civicrm/ext/afform/core/Civi/Api4/Action/Afform/Get.php(20): Civi::service()
#4 /srv/www/mysite/wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/BasicGetAction.php(52): Civi\Api4\Action\Afform\Get->getRecords()
#5 /srv/www/mysite/wp-content/plugins/civicrm/civicrm/Civi/Api4/Provider/ActionObjectProvider.php(72): Civi\Api4\Generic\BasicGetAction->_run()
#6 /srv/www/mysite/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(158): Civi\Api4\Provider\ActionObjectProvider->invoke()
#7 /srv/www/mysite/wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/AbstractAction.php(250): Civi\API\Kernel->runRequest()
#8 /srv/www/mysite/wp-content/plugins/civicrm/civicrm/ext/afform/core/afform.php(591): Civi\Api4\Generic\AbstractAction->execute()
#9 /srv/www/mysite/wp-content/plugins/civicrm/civicrm/CRM/Utils/Hook.php(275): afform_civicrm_referenceCounts()
#10 /srv/www/mysite/wp-content/plugins/civicrm/civicrm/CRM/Utils/Hook/WordPress.php(136): CRM_Utils_Hook->runHooks()
#11 /srv/www/mysite/wp-content/plugins/civicrm/civicrm/Civi/Core/CiviEventDispatcher.php(310): CRM_Utils_Hook_WordPress->invokeViaUF()
#12 /srv/www/mysite/wp-content/plugins/civicrm/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(251): Civi\Core\CiviEventDispatcher::delegateToUF()
#13 /srv/www/mysite/wp-content/plugins/civicrm/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(73): Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
#14 /srv/www/mysite/wp-content/plugins/civicrm/civicrm/Civi/Core/CiviEventDispatcher.php(260): Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
#15 /srv/www/mysite/wp-content/plugins/civicrm/civicrm/CRM/Utils/Hook.php(167): Civi\Core\CiviEventDispatcher->dispatch()
#16 /srv/www/mysite/wp-content/plugins/civicrm/civicrm/CRM/Utils/Hook.php(821): CRM_Utils_Hook->invoke()
#17 /srv/www/mysite/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(2580): CRM_Utils_Hook::referenceCounts()
#18 /srv/www/mysite/wp-content/plugins/civicrm/civicrm/Civi/Api4/Utils/CoreUtil.php(257): CRM_Core_DAO->getReferenceCounts()
#19 /srv/www/mysite/wp-content/plugins/civicrm/civicrm/CRM/Core/ManagedEntities.php(319): Civi\Api4\Utils\CoreUtil::getRefCount()
#20 /srv/www/mysite/wp-content/plugins/civicrm/civicrm/CRM/Core/ManagedEntities.php(149): CRM_Core_ManagedEntities->removeStaleEntity()
#21 /srv/www/mysite/wp-content/plugins/civicrm/civicrm/CRM/Core/ManagedEntities.php(113): CRM_Core_ManagedEntities->reconcileEntities()
#22 /srv/www/mysite/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(417): CRM_Core_ManagedEntities->reconcile()
#23 /srv/www/mysite/wp-content/plugins/civicrm/civicrm/CRM/Upgrade/Form.php(799): CRM_Core_Invoke::rebuildMenuAndCaches()
#24 /srv/www/mysite/wp-content/plugins/civicrm/civicrm/CRM/Queue/Task.php(101): CRM_Upgrade_Form::doCoreFinish()
#25 /srv/www/mysite/wp-content/plugins/civicrm/civicrm/CRM/Queue/Runner.php(255): CRM_Queue_Task->run()
#26 /srv/www/mysite/wp-content/plugins/civicrm/civicrm/CRM/Queue/Page/AJAX.php(36): CRM_Queue_Runner->runNext()
#27 /srv/www/mysite/wp-content/plugins/civicrm/civicrm/CRM/Queue/ErrorPolicy.php(89): CRM_Queue_Page_AJAX::{closure}()
#28 /srv/www/mysite/wp-content/plugins/civicrm/civicrm/CRM/Queue/Page/AJAX.php(38): CRM_Queue_ErrorPolicy->call()
#29 /srv/www/mysite/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(285): CRM_Queue_Page_AJAX::runNext()
#30 /srv/www/mysite/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(69): CRM_Core_Invoke::runItem()
#31 /srv/www/mysite/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke()
#32 /srv/www/mysite/wp-content/plugins/civicrm/civicrm.php(1199): CRM_Core_Invoke::invoke()
#33 /srv/www/mysite/wp-includes/class-wp-hook.php(307): CiviCRM_For_WordPress->invoke()
#34 /srv/www/mysite/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()
#35 /srv/www/mysite/wp-includes/plugin.php(474): WP_Hook->do_action()
#36 /srv/www/mysite/wp-admin/admin.php(259): do_action()
#37 {main}https://lab.civicrm.org/dev/core/-/issues/4270CiviCRM Log File: Dates and Security2023-09-22T18:28:09ZAlanDixonCiviCRM Log File: Dates and SecurityOverview
----------------------------------------
The (text) log file generated by CiviCRM has three issues:
1. The risk of XSS (as described here: https://github.com/adixon/ca.civicrm.logviewer/issues/11)
2. The formatting of date/times...Overview
----------------------------------------
The (text) log file generated by CiviCRM has three issues:
1. The risk of XSS (as described here: https://github.com/adixon/ca.civicrm.logviewer/issues/11)
2. The formatting of date/times that are dependent on locale (as noted here: https://github.com/adixon/ca.civicrm.logviewer/pull/10)
3. The timezone of the date/time which is dependent on the source of the error but not specified in the output (i.e. the date time is of unknown and indeterminate timzeone).
Expected behaviour
----------------------------------------
1. I would expect the date/time of the error to be consistent and machine parseable and the timezone explicit.
2. I would expect the urls in the file to be XSS safe.
Comments
----------------------------------------
As per @bgm the log file date/times may be coming from a PEAR package.https://lab.civicrm.org/dev/core/-/issues/4273Allow double opt-in email (and other emails that you don't want a reply from)...2023-07-05T23:48:40ZJamie Novick - CompucoAllow double opt-in email (and other emails that you don't want a reply from) to use a user configured "mail from" address**How it works currently:**
Currently CiviCRM forces the double opt in email to an email address which is:
the words "do not reply" + the domain of the site from your default mail account configured here: https://dmaster.demo.civicrm.o...**How it works currently:**
Currently CiviCRM forces the double opt in email to an email address which is:
the words "do not reply" + the domain of the site from your default mail account configured here: https://dmaster.demo.civicrm.org/civicrm/admin/mailSettings?reset=1
https://github.com/civicrm/civicrm-core/blob/6f14847526226279076f63cc472afc18f2ce27e6/CRM/Core/BAO/Domain.php#L364
**What is the issue?**
The problem with this is that the default mail account email domain (used for bounce handling), may not be the same domain that you want to use as the from address for your double opt in emails (or for any other email that you don't want a reply from).
**Proposed solution**
We already have a place to configure the available from addresses in the system. This is the option group here: https://dmaster.demo.civicrm.org/civicrm/admin/options/from_email_address?reset=1
As such I would suggest that:
1. We create a new setting on the CiviMail component settings (https://dmaster.demo.civicrm.org/civicrm/admin/setting/preferences/mailing?reset=1) (suggest this is below "Enable Double Opt-in for Profiles which use the "Add to Group" setting":
- called "Email From Address to use where a reply is not expected".
- Field type - single select,
- Options to show from available "Email From Addresses" here: https://dmaster.demo.civicrm.org/civicrm/admin/options/from_email_address?reset=1.
- Not required
- Help: "Specify an Email From Address to use when the system sends an email but a reply is not expected, for example when a user is sent an email for a double opt-in. Leaving this blank will use the default which will be do-not-reply@default_domain where the default_domain will be the email domain address of your default mailing account also used for bounce handling. You can add additional Email From Addresses here [link to admin/options/from_email_address?reset=1].
2. If an email address is specified in the setting above it should be used instead of the current hardcoded default value.
**Next steps**
We're happy to submit a PR for this so if we can get this concept approved we will submit a core PR asap.
Thankshttps://lab.civicrm.org/dev/core/-/issues/4276Using profile in create mode with dedupe rule allows for leaking of private i...2023-05-24T06:51:10ZlarsssandergreenUsing profile in create mode with dedupe rule allows for leaking of private informationOverview
----------------------------------------
An anonymous user filling in a profile who leaves fields blank in create mode with deduping enabled will be shown the existing values for those fields if a duplicate is found. So if you h...Overview
----------------------------------------
An anonymous user filling in a profile who leaves fields blank in create mode with deduping enabled will be shown the existing values for those fields if a duplicate is found. So if you have an unsupervised dedupe rule of email only, then anyone can enter a contact's email and leave the remaining fields blank. They will shown existing data for that contact for fields that appear on the profile. This creates the potential to leak private information to anyone who knows minimal information about a contact and potentially could be used maliciously to expose data.
Reproduction steps
----------------------------------------
1. Create a profile that includes the fields in the your unsupervised dedupe rule, plus any other fields desired.
1. Use the profile in create mode anonymously, filling in only the fields required to match to an existing contact and leaving the other fields empty.
1. After submitting the profile, you are shown all the data for the fields left blank for that existing contact.
Current behaviour
----------------------------------------
Profile fields that are submitted blank are shown with existing data on the profile confirmation screen.
Additionally, the confirmation page URL contains both the contact id and checksum for the matched contact, which could be used to access other profiles or forms, exposing additional data.
Expected behaviour
----------------------------------------
All profile fields should be shown exactly as submitted on the profile confirmation screen.
The confirmation page URL should not show the contact id and checksum for the matched contact.
Comments
----------------------------------------
Have marked this confidential, since there is a potential for malicious use.https://lab.civicrm.org/dev/core/-/issues/4280FormBuilder: Form with required "Existing Contact" can't be submitted2023-05-08T07:53:11ZJonGoldFormBuilder: Form with required "Existing Contact" can't be submittedOverview
----------------------------------------
If you put an "Existing Contact" field on a FormBuilder form, and make it required, you can't submit the form.
Reproduction steps
----------------------------------------
1. See above. ...Overview
----------------------------------------
If you put an "Existing Contact" field on a FormBuilder form, and make it required, you can't submit the form.
Reproduction steps
----------------------------------------
1. See above. Here is sample HTML/JSON for a simple case:
```json
{
"type": "form",
"title": "EntityRef required test",
"icon": "fa-list-alt",
"server_route": "civicrm/entityref-req",
"permission": "access CiviCRM",
"create_submission": true,
"requires": [],
"description": "",
"is_dashlet": false,
"is_public": false,
"is_token": false,
"entity_type": null,
"join_entity": null,
"contact_summary": null,
"summary_contact_type": null,
"redirect": null,
"navigation": null
}
```
```html
<af-form ctrl="afform">
<af-entity data="{contact_type: 'Organization', source: 'EntityRef required test'}" type="Contact" name="Organization1" label="Organization 1" actions="{create: true, update: true}" security="RBAC" />
<fieldset af-fieldset="Organization1" class="af-container" af-title="Organization 1">
<div class="af-container">
<af-field name="id" defn="{required: true, input_attrs: {}}" />
</div>
</fieldset>
<button class="af-button btn btn-primary" crm-icon="fa-check" ng-click="afform.submit()">Submit</button>
</af-form>
```
Current behaviour
----------------------------------------
```
Form Error
Please fill all required fields.
```
Expected behaviour
----------------------------------------
Form is submitted if the field is populated.https://lab.civicrm.org/dev/core/-/issues/4285Changing participant status should not add an Event Registration activity2023-05-24T06:53:21ZlarsssandergreenChanging participant status should not add an Event Registration activityIf you change a participant status, for example from Registered to Attended, an activity of type Event Registration is added with subject Event Name - Role - Status. It isn't an event registration, so the activity type should probably be...If you change a participant status, for example from Registered to Attended, an activity of type Event Registration is added with subject Event Name - Role - Status. It isn't an event registration, so the activity type should probably be Change Registration, but I'm not sure we want an activity recorded at all. Is this useful or does it just make the Activities tab less useful by filling it up with unimportant details?
For comparison, we don't record an activity for a change in contribution status, but we do record an activity for a change in membership status. This seems reasonable and the change in participant status seems more like a change in contribution status.
If someone cancels through the self service / Transfer or Cancel mechanism, a separate cancellation activity is recorded (so you end up with two activities for the cancellation).
My proposal is to not record an activity on participant status change, except through the self service mechanism.
If people feel like some of those activities are useful, maybe we could only record activities for changes to or to and from cancelled and transferred status. These should be Change Registration type activities and the separate activity from the self service mechanism would have to be removed so there is no duplication.https://lab.civicrm.org/dev/core/-/issues/4286Fatal error with managed custom groups containing duplicate field names2023-05-17T10:45:16ZAndrew WestFatal error with managed custom groups containing duplicate field namesOverview
----------------------------------------
I have two custom groups. Each contains a field titled 'Status'. In the database they have the same 'name': 'status'.
I want these groups to be managed entities. So I export both groups ...Overview
----------------------------------------
I have two custom groups. Each contains a field titled 'Status'. In the database they have the same 'name': 'status'.
I want these groups to be managed entities. So I export both groups using the 'export' command on the 'CustomGroup' entity. I set the export to match on 'name' - this seems the sensible field as users can't change it.
This helpfully exports everything I need: I get a .mdg.php file with each custom groups, their fields, and the fields' option values.
But when I enable the extension on a test machine I get a fatal error because of the duplicate 'name'.
The first field gets created fine, but when creating the second field it erroneously matches on the first one so thinks it exists already, and things go wrong from there.
The fix is to set the 'match' parameter on the managed entity to include the custom group name too:
```
'match' => [
'name','custom_group_id.name',
],
```
But you can't do this through the UI. The 'match' option on the CustomGroup Export action doesn't include fields from the CustomField entity (let alone the name).
Reproduction steps
----------------------------------------
1. Create a new extension with the two managed entities from [this gist](https://gist.github.com/awestuk/a9956427ce1937fcbd8fddeed675cef5)
2. Try to enable it
Environment information
----------------------------------------
* __CiviCRM:__ _5.60_ <!-- If this problem relates to an upgrade, then specify both old and new versions -->
* __PHP:__ _7.4_
Comments
----------------------------------------
I can fix it manually by changing the field names, or by manually adding the custom_group_id.name to the .mgd.php files. But I figure duplicate names are common enough to trip people up, and it was a tough one to debug, so I thought it was worth reporting.https://lab.civicrm.org/dev/core/-/issues/4287PHP 8 - Undefined variable warnings from Smarty appear in email notifications2023-11-14T01:40:49ZjasonhildebrandPHP 8 - Undefined variable warnings from Smarty appear in email notificationsOverview
----------------------------------------
We recently upgraded Civi to 5.60 and PHP 8 (was previously PHP 7.x). Our site uses Drupal 7.
Since the upgrade, we are seeing errors such as ```Undefined array key "phone_type"``` appe...Overview
----------------------------------------
We recently upgraded Civi to 5.60 and PHP 8 (was previously PHP 7.x). Our site uses Drupal 7.
Since the upgrade, we are seeing errors such as ```Undefined array key "phone_type"``` appearing in our email notifications to event participants.
![screenshot](/uploads/4cee73442124f9c2a3b1158e8925c1e7/screenshot.png)
We have taken action to suppress errors and warnings in Drupal, but this does not appear to help when smarty is used to render email notifications.
Expected behaviour
----------------------------------------
I would expect these warnings not to appear, or to be suppressible with setting, so that they can be turned off in production.
Workaround
-----------
As a workaround, I added the 3 lines marked below to civicrm/CRM/Core/TokenSmarty.php in order to suppress the warnings before rendering, then restore the error_reporting to the original setting after rendering.
Perhaps this kind of approach could be added to Civi with a configuration setting to turn these messages on/off.
```
// Evaluate/render templates
try {
if ($useSmarty) {
$orig_reporting = error_reporting(); // ADDED
error_reporting(0); // ADDED
CRM_Core_Smarty::singleton()->pushScope($smartyAssigns);
}
$tokenProcessor->evaluate();
foreach ($messages as $messageId => $ign) {
foreach ($tokenProcessor->getRows() as $row) {
$result[$messageId] = $row->render($messageId);
}
}
}
finally {
if ($useSmarty) {
CRM_Core_Smarty::singleton()->popScope();
error_reporting($orig_reporting); // ADDED
}
}
```https://lab.civicrm.org/dev/core/-/issues/4288Price set option limit = 0 should mean no spaces, rather than no limit2023-05-15T08:16:42ZlarsssandergreenPrice set option limit = 0 should mean no spaces, rather than no limitIf you set a price set option limit to 0, this is the same as not specifying a limit. I would expect that a limit of 0 would mean there are no spaces. Setting the limit to 0 is different than disabling the price set option, as disabling ...If you set a price set option limit to 0, this is the same as not specifying a limit. I would expect that a limit of 0 would mean there are no spaces. Setting the limit to 0 is different than disabling the price set option, as disabling makes it so the option does not appear on public forms, while I expect setting the limit to 0 would just make it sold out, but still appear. I can't think of a good reason you would want 0 to be the same as no limit, but maybe others can?
Will submit PR unless there are objections. Otherwise, will add help text.https://lab.civicrm.org/dev/core/-/issues/4290SearchKit: Return results faster by optimizing access check2023-05-15T08:14:11ZlarsssandergreenSearchKit: Return results faster by optimizing access checkThrough some testing, it looks like quite a bit of the execution time for SearchKit results on Compose Search, at least for relatively simple queries, is being spent checking the current user's access to edit or delete the specific entit...Through some testing, it looks like quite a bit of the execution time for SearchKit results on Compose Search, at least for relatively simple queries, is being spent checking the current user's access to edit or delete the specific entity for the View / Edit / Delete menu in the last column. It's not too bad with just 50 rows, but if you increase the page size to 100 or more, there's a pretty perceptible difference between checking the access and skipping that access check. I had a few thoughts about how we could improve this:
1. Since we aren't actually showing the links until the user clicks on the hamburger menu, we could just add the links as usual, but then check access in JS and only unhide those that the user has access to. This way we aren't doing 100 checkAccess API calls per page of 50 entities (one for update, one for delete). This would make the Compose Search page faster as well as any Displays that contain the same menu, but wouldn't help if there are links or buttons in a Display.
2. I think quite a few of the users accessing Compose Search probably have superadmin, so we could check that at the start of the process and then skip the access checks for each row.
3. Maybe it would make sense to make it possible to pass an array of ids to the checkAccess API. I don't know the details of how this works, but imagine that would speed up the process. At least for Contacts, there already is `allowList()`, so maybe this could be implemented just for Contacts without too much trouble.https://lab.civicrm.org/dev/core/-/issues/4291Smarty variable tokens not correctly processed in message subject2023-09-24T22:40:26Zmagnolia61Smarty variable tokens not correctly processed in message subjectOverview
----------------------------------------
Smarty variable tokens are not processed in message subject
Reproduction steps
----------------------------------------
1. In a message template body html we have for instance {capture a...Overview
----------------------------------------
Smarty variable tokens are not processed in message subject
Reproduction steps
----------------------------------------
1. In a message template body html we have for instance {capture assign="firstname"}{contact.first_name}{/capture}
2. We use {$firstname} in the body.
3. We use {$firstname} in the subject.
4. When sending a email manually the subject token gets replaced.
5. When sending via scheduled reminders or civirules the subject token does not get replaced.
6. Worse: our automatic birthday mail batch (civirules) got firstnames of the previous contact (only in the subject)
Current behaviour
----------------------------------------
smart variables are sometimes not correctly replaced as a token in the message subject
Expected behaviour
----------------------------------------
smart variables are sometimes always correctly replaced as a token in the message subject
Environment information
----------------------------------------
- CiviCRM: 5.61.2
- CMS: Drupal 7.97
- PHP: 7.4.33 (fpm-fcgi)
- Database: 10.5.19-MariaDB-0+deb11u2-log engine: InnoDB 10 row format: Dynamic
- Webserver: Apache/2.4.56 (Debian)
- OS: Linux
Comments
----------------------------------------
I will doublecheck if this is only the case with civirules or also with the scheduled remindershttps://lab.civicrm.org/dev/core/-/issues/4292Add validation to verify html body content for empty text/ only image in mailing2023-05-24T06:23:56ZyashodhaAdd validation to verify html body content for empty text/ only image in mailingAdd validation to verify html body content for empty text (if img are used) and show the error accordingly.Add validation to verify html body content for empty text (if img are used) and show the error accordingly.yashodhayashodhahttps://lab.civicrm.org/dev/core/-/issues/4293Uncaught SyntaxError: '#' not followed by identifier2023-11-23T07:47:01ZBastien HoUncaught SyntaxError: '#' not followed by identifierIn a contribution page, I get an `Uncaught SyntaxError: '#' not followed by identifier` error in the console.
Reproduction steps
----------------------------------------
1. Create a contribution page.
1. Insert it in a WordPress page.
1...In a contribution page, I get an `Uncaught SyntaxError: '#' not followed by identifier` error in the console.
Reproduction steps
----------------------------------------
1. Create a contribution page.
1. Insert it in a WordPress page.
1. Display the page.
1. Open the console of the navigator
In _templates/CRM/Contribute/Form/Contribution/Main.tpl_, the following lines are misinterpreted before being output:
```js
function useAmountOther() {
var priceset = {/literal}
{if $contriPriceset}'{$contriPriceset}'
{else}0
{/if}
{literal};
for (i = 0; i < document.Main.elements.length; i++) {
element = document.Main.elements[i];
if (element.type == 'radio' && element.name == priceset) {
if (element.value == '0') {
element.click();
} else {
element.checked = false;
}
}
}
}
```
In the source of the generated page:
```js
function useAmountOther() {
var priceset =
0
;
for (i = 0; i < document.Main.elements.length; i++) {
element = document.Main.elements[i];
if (element.type == 'radio' && element.name == priceset) {
if (element.value == '0') {
element.click();
} else {
element.checked = false;
}
}
}
}
```
Environment information
----------------------------------------
<!-- Some of the items below may not be relevant for every bug - if in doubt please include more information than you think is neccessary. -->
* __Browser:__ _Firefox 112_
* __CiviCRM:__ _5.61.2_
* __PHP:__ _8.0_
* __CMS:__ _WordPress 6.2_
* __Database:__ _MariaDB 10.5_
* __Web Server:__ _Apache 2.4_https://lab.civicrm.org/dev/core/-/issues/4294Fix mailto links that get converted to traceable urls2023-06-19T23:31:10ZyashodhaFix mailto links that get converted to traceable urlsmailto links also get converted to trackable urls causing issues. Let's avoid doing that.mailto links also get converted to trackable urls causing issues. Let's avoid doing that.yashodhayashodhahttps://lab.civicrm.org/dev/core/-/issues/4296FormBuilder filters suggestion: text filter as select2023-06-08T18:02:44Zaydunsaidan.saunders@squiffle.ukFormBuilder filters suggestion: text filter as selectOverview
----------------------------------------
For FormBuilder filters, it would be useful to have the option to turn `Text` into `Select`.
Example use-case
----------------------------------------
For a search return results like:
...Overview
----------------------------------------
For FormBuilder filters, it would be useful to have the option to turn `Text` into `Select`.
Example use-case
----------------------------------------
For a search return results like:
```
Org, Contact
------------
Org1, ContactA
Org1, ContactB
Org1, ContactC
Org2, ContactD
Org2, ContactE
```
you can add a filter on Org Display Name which is displayed as a text box.
It would be nice to be able to present this as a `Select` dropdown of 'Org1', 'Org2' etc (or even multi-select). The configuration for the filter provides a `Type` box with several options, so add a `Select` one to that (in addition to the existing `Text`).
The current text filter is a substring match which means that if one display name is a substring of another, you can't filter to just the shorter name. So eg 'Org1', 'Org1 - committee A', 'Org1 - committee B' you can't just show 'Org1'. Turning this into a `Select` should either exact match on the text string or convert to filtering by `id`.https://lab.civicrm.org/dev/core/-/issues/4297Do help links go after the label or after the field?2023-06-20T20:38:21ZlarsssandergreenDo help links go after the label or after the field?It seems like on some backend forms, the little help links are after the label, while in other places they are after the field itself. If we can agree on one or the other, I will adjust the templates so forms are consistent. My unscienti...It seems like on some backend forms, the little help links are after the label, while in other places they are after the field itself. If we can agree on one or the other, I will adjust the templates so forms are consistent. My unscientific survey indicates that we have about 2/3 after the label and 1/3 after the field right now.
Here's an example with both:
![image](/uploads/28270ce52cc725f384c3e4bcb368442a/image.png)
Additional consideration: When there is both a setting and a help, probably having one after the other would be not great.
![image](/uploads/2966630753c68c090d2a80269a488c34/image.png)
Also, there are a few with help at the end of the description
![image](/uploads/964d812410ed131320947dc6d7b0b7c5/image.png)
Some fields it has to be after the field because there is no label
![image](/uploads/d2f943517edf44b307599502855c4346/image.png)
Checkboxes are always after the label, but that's at the end of the line.
![image](/uploads/f7d02999614ef14009d158d8236b9951/image.png)
With multiple checkboxes, it has to be after the label, there isn't really any other option.
![image](/uploads/155a387d37d5452b9e4f7373cb7a447a/image.png)
Another different layout, I think it only makes sense after the label here
![image](/uploads/d13c5bd26e5bb9aff8f72adf5dc2f109/image.png)https://lab.civicrm.org/dev/core/-/issues/4299Send contribution receipt when contribution completed by recording payment on...2023-08-01T14:42:08ZlarsssandergreenSend contribution receipt when contribution completed by recording payment on the backendThrough discussion in this [PR](https://github.com/civicrm/civicrm-core/pull/26247), it has become clear that there is an inconsistency in which message templates are sent when completing a pending contribution with a payment, depending ...Through discussion in this [PR](https://github.com/civicrm/civicrm-core/pull/26247), it has become clear that there is an inconsistency in which message templates are sent when completing a pending contribution with a payment, depending on where the payment is recorded.
If the payment is recorded via API and the receipt has not yet been set, a contribution receipt template is sent.
If the payment is recorded via a Search Action and the receipt has not been sent, a contribution receipt template is sent.
If the payment is recorded via Record Payment in the UI, there is an option to send to send a receipt, but if selected a "Additional Payment Receipt or Refund Notification" template is sent.
I think that in the third case, for consistency, we should send a contribution receipt template as long as the contribution is now completed. The same logic works with membership receipt templates.https://lab.civicrm.org/dev/core/-/issues/4301FormBuilder: Allow placeholder text to be configured2023-05-24T06:34:31Zaydunsaidan.saunders@squiffle.ukFormBuilder: Allow placeholder text to be configuredIt would be nice to be able to specify placeholder text on form fields such as filters.It would be nice to be able to specify placeholder text on form fields such as filters.https://lab.civicrm.org/dev/core/-/issues/4304getUFLocale() is not setting the proper locale2023-05-24T06:37:15ZshaneonabikegetUFLocale() is not setting the proper locale## Overview
Presently, the function ```getUFLocale()``` obtains the interface language for Wordpress with integration with WPML. The present formula is using incorrect ```apply_filters``` to generate the wrong locale for front-endusers....## Overview
Presently, the function ```getUFLocale()``` obtains the interface language for Wordpress with integration with WPML. The present formula is using incorrect ```apply_filters``` to generate the wrong locale for front-endusers.
This was discovered while working validating the pull request [#289](https://github.com/civicrm/civicrm-wordpress/pull/289) for better WPML integration for front-end users.
## What should happen
The link should be generated in the language that the current user has set.
## What is the problem
```php
// Maybe override with the locale that WPML reports.
elseif (defined('ICL_LANGUAGE_CODE')) {
$languages = apply_filters('wpml_active_languages', NULL);
foreach ($languages as $language) {
if ($language['active']) {
$locale = $language['default_locale'];
break;
}
}
}
```
According to the docs, ```apply_filters('wpml_active_languages', NULL)``` only retrieves a list of languages, but this has no bearing on the user's current language. The value ```$language['active']``` refers to whether the language is active or not. In my case, I have seen this reported as _false_ in some cases where languages are active - go figure :shrug: .
So we need to use ```apply_filters('wpml_current_language')``` [to obtain](https://wpml.org/wpml-hook/wpml_current_language/) the users front-end language.
I'll post a patch for this and link it to this one.
cc @kcristianohttps://lab.civicrm.org/dev/core/-/issues/4308CryptoKeys - Converting CryptoException into status messages2023-06-05T14:10:29ZVangelisPCryptoKeys - Converting CryptoException into status messages### Overview
From time to time, we clone/replicate our live sites into our development servers to do some reviews/coding enhancements etc. Since the live sites are having a different key from the development site(s), whenever we try to ...### Overview
From time to time, we clone/replicate our live sites into our development servers to do some reviews/coding enhancements etc. Since the live sites are having a different key from the development site(s), whenever we try to access the path `/civicrm/admin/setting/smtp?reset=1` (and assuming that we had set the configuration to SMTP with a username & password in live), we end up with an exception error: "Failed to find key by ID or tag", leaving us unable to access the page so that we can modify or re-enter the SMTP password.
### Reproduction steps
* Configure `CIVICRM_CRED_KEYS`
* Go to `/civicrm/admin/setting/smtp?reset=1`
* Set up the mailer as SMTP and store a password
* Clone the site's database and filebase (except the `civicrm.settings.php`) into another site OR change the `CIVICRM_CRED_KEYS`
* Try to access the page `/civicrm/admin/setting/smtp?reset=1`. You will get an exception error and the page won't load.
### Expected behaviour
* Manage to get to the page `/civicrm/admin/setting/smtp?reset=1` but throw a status message that there's something wrong with the stored password.
### Proposed solution
* On `/Civi/Crypto/CryptoRegistry.php` convert the `CryptoException`s into Status messages
* On `/Civi/Crypto/CryptoToken.php` check if the variable `$key` is null or set and if not, return the `$plaintext`
This way, even if the system cannot decode/decrypt properly the key, we will still be able to return to the password page but also throw the notices to the visitor.
I'm assuming that this exact behaviour/effect fires up wherever we use the crypto functionality.
I am also aware that in order to fix this, one needs to also configure the *same* `CIVICRM_CRED_KEY` as seen in the live site.
If this makes any sense, I can provide a patch/PR.
### Environment information
* CiviCRM: 5.57
* PHP: 7.4.33
* CMS: Drupal 9.4.15https://lab.civicrm.org/dev/core/-/issues/4311Undefined array key warnings when entering a report page2023-06-06T05:54:40ZTobias KrauseUndefined array key warnings when entering a report pageWhen a report page is accessed several warnings appear in watchdog. For example the path of one of the reports is /civicrm/report/instance/3, the warnings are:
```
Warning: Undefined array key "batch_id_op" in include() (Zeile 42 in sit...When a report page is accessed several warnings appear in watchdog. For example the path of one of the reports is /civicrm/report/instance/3, the warnings are:
```
Warning: Undefined array key "batch_id_op" in include() (Zeile 42 in sites\default\files\private\civicrm\templates_c\en_US\%%E0\E0C\E0C36992%%Filters.tpl.php)
Warning: Trying to access array offset on value of type null in include() (Zeile 42 in sites\default\files\private\civicrm\templates_c\en_US\%%E0\E0C\E0C36992%%Filters.tpl.php)
Warning: Undefined array key "type" in include() (Zeile 48 in sites\default\files\private\civicrm\templates_c\en_US\%%1B\1BD\1BD7DE8F%%Statistics.tpl.php)
Warning: Undefined array key "type" in include() (Zeile 51 in sites\default\files\private\civicrm\templates_c\en_US\%%1B\1BD\1BD7DE8F%%Statistics.tpl.php)
```https://lab.civicrm.org/dev/core/-/issues/4312Undefined array key and deprecated warnings on contributions overview page2023-06-06T05:55:19ZTobias KrauseUndefined array key and deprecated warnings on contributions overview pageWhen going to /civicrm/contact/view/contribution many "array undefined" warnings appear in watchdog:
```
Warning: Undefined array key "selectedChild" in include() (Zeile 11 in C:\wamp64\www\civicrm\httpdocs\sites\default\files\private\c...When going to /civicrm/contact/view/contribution many "array undefined" warnings appear in watchdog:
```
Warning: Undefined array key "selectedChild" in include() (Zeile 11 in C:\wamp64\www\civicrm\httpdocs\sites\default\files\private\civicrm\templates_c\en_US\%%6F\6FD\6FDADEDF%%TabSelected.tpl.php)
Warning: Undefined array key "type" in include() (Zeile 17 in C:\wamp64\www\civicrm\httpdocs\sites\default\files\private\civicrm\templates_c\en_US\%%3D\3D4\3D44E36C%%Selector.tpl.php)
**(I think this warning appears once for each contribution in the list)**
Warning: Undefined array key "softCredit" in include() (Zeile 93 in C:\wamp64\www\civicrm\httpdocs\sites\default\files\private\civicrm\templates_c\en_US\%%84\843\843D5262%%Tab.tpl.php)
Warning: Undefined array key "payment_processor" in include() (Zeile 12 in C:\wamp64\www\civicrm\httpdocs\sites\default\files\private\civicrm\templates_c\en_US\%%1B\1B6\1B6ACE3B%%ContributionRecurSelector.tpl.php)
Warning: Undefined array key "recurId" in include() (Zeile 12 in C:\wamp64\www\civicrm\httpdocs\sites\default\files\private\civicrm\templates_c\en_US\%%1B\1B6\1B6ACE3B%%ContributionRecurSelector.tpl.php)
Deprecated function: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in smarty_modifier_replace() (Zeile 25 in C:\wamp64\www\civicrm\vendor\civicrm\civicrm-packages\Smarty\plugins\modifier.replace.php)
```https://lab.civicrm.org/dev/core/-/issues/4313Undefined array keys warnings when activities of a contact are listed2023-06-06T05:55:14ZTobias KrauseUndefined array keys warnings when activities of a contact are listedWhen you open a contact and click on the tab "Activities" we see the following warnings in watchdog regardless of how many activities are listed there.
```
Warning: Undefined array key "addAssigneeContact" in include() (Zeile 7 in C:\wa...When you open a contact and click on the tab "Activities" we see the following warnings in watchdog regardless of how many activities are listed there.
```
Warning: Undefined array key "addAssigneeContact" in include() (Zeile 7 in C:\wamp64\www\civicrm\httpdocs\sites\default\files\private\civicrm\templates_c\en_US\%%E3\E36\E366782B%%Tab.tpl.php)
Warning: Undefined array key "addTargetContact" in include() (Zeile 7 in C:\wamp64\www\civicrm\httpdocs\sites\default\files\private\civicrm\templates_c\en_US\%%E3\E36\E366782B%%Tab.tpl.php)
Warning: Undefined array key "hideRelativeLabel" in include() (Zeile 9 in C:\wamp64\www\civicrm\httpdocs\sites\default\files\private\civicrm\templates_c\en_US\%%48\480\480BECF5%%DatePickerRange.tpl.php)
```https://lab.civicrm.org/dev/core/-/issues/4314Many undefined array and deprecated warnings when adding a new activity for a...2023-11-15T20:11:28ZTobias KrauseMany undefined array and deprecated warnings when adding a new activity for a contact- Open a contact and go to the "Activities" tab
- Click on "+ New Activity"
In many case we see a lot of warnings appearing in watchdog - in total 21 but it seems that the following 3 messages are repeated 7 times:
```
Warning: Undefi...- Open a contact and go to the "Activities" tab
- Click on "+ New Activity"
In many case we see a lot of warnings appearing in watchdog - in total 21 but it seems that the following 3 messages are repeated 7 times:
```
Warning: Undefined array key "params" in include() (Zeile 5 in C:\wamp64\www\civicrm\httpdocs\sites\default\files\private\civicrm\templates_c\en_US\%%DF\DF0\DF0B0562%%RecurringEntity.hlp.php)
Warning: Trying to access array offset on value of type null in include() (Zeile 5 in C:\wamp64\www\civicrm\httpdocs\sites\default\files\private\civicrm\templates_c\en_US\%%DF\DF0\DF0B0562%%RecurringEntity.hlp.php)
Deprecated function: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in smarty_modifier_lower() (Zeile 23 in C:\wamp64\www\civicrm\vendor\civicrm\civicrm-packages\Smarty\plugins\modifier.lower.php)
```
For the last warning: I mentioned it already in https://lab.civicrm.org/dev/core/-/issues/4312 - maybe this warning might be an issue on it's ownhttps://lab.civicrm.org/dev/core/-/issues/4315Undefined array warnings when editing the emails of a contact2023-06-06T05:54:59ZTobias KrauseUndefined array warnings when editing the emails of a contact- go to a contact
- click on "Add or edit email" when you hover over the email section
On click the following messages appear in watchdog:
```
Warning: Undefined array key "oplock_ts" in include() (Zeile 5 in C:\wamp64\www\civicrm\http...- go to a contact
- click on "Add or edit email" when you hover over the email section
On click the following messages appear in watchdog:
```
Warning: Undefined array key "oplock_ts" in include() (Zeile 5 in C:\wamp64\www\civicrm\httpdocs\sites\default\files\private\civicrm\templates_c\en_US\%%97\973\973BB488%%Email.tpl.php)
Warning: Trying to access array offset on value of type null in include() (Zeile 5 in C:\wamp64\www\civicrm\httpdocs\sites\default\files\private\civicrm\templates_c\en_US\%%97\973\973BB488%%Email.tpl.php)
```
When saving for each email the following error message appears in watchdog:
`Warning: Undefined array key "mailingOutboundOption" in include() (Zeile 37 in C:\wamp64\www\civicrm\httpdocs\sites\default\files\private\civicrm\templates_c\en_US\%%09\098\0983F079%%Email.tpl.php)`https://lab.civicrm.org/dev/core/-/issues/4318Contributions sometimes lack line items, leads to fatal error upon "Download ...2023-06-21T00:11:44ZAllenShawContributions sometimes lack line items, leads to fatal error upon "Download Invoice"Originally reported at https://civicrm.stackexchange.com/questions/44907/contribution-has-no-line-items-shouldnt-that-be-impossible
**Problem and observation:**
On several sites I have found contributions which have no line items -- th...Originally reported at https://civicrm.stackexchange.com/questions/44907/contribution-has-no-line-items-shouldnt-that-be-impossible
**Problem and observation:**
On several sites I have found contributions which have no line items -- that is, rows in civicrm_contribution that have no corresponding rows in civicrm_line_item.
![no-line-items](/uploads/0f3958d00084586a43d7c04419a29ab7/no-line-items.png)
Responses at the above-linked SE question indicate that this is not normal.
This situation leads to a fatal error ("Return value of CRM_Financial_BAO_Order::getPriceSetID() must be of the type int, null returned") when attempting to generate a PDF invoice with "Download Invoice" for the given contribution, apparently on the assumption that this situation is not expected by core code.
**Detecting ffected sites:**
I've observed this on several sites (all currently running CiviCRM 5.58.1 but all having existed much longer), including one local dev site that sees relatively light usage.
This SQL query identifies contributions lacking line items:
```
SELECT count(*)
FROM
civicrm_contribution ctr
left join civicrm_line_item li on li.contribution_id = ctr.id
where li.id is null;
```
**Unable to repro:**
I'm unable to reproduce this situation at will, except by manually deleting rows in civicrm_line_item via API or SQL. It seems any contribution record will, by design, have at least one line_item, even if using a quick-config contribution instead of a visible price set, or if manually creating even a zero-dollar contribution in the back-end.
**Moving forward:**
Until we have a solid set of steps to repro, I'm not sure there's much we can do here. Hopefully this issue can serve as a place for others to share their findings (and hopefully we'll get to some repro steps at some point).https://lab.civicrm.org/dev/core/-/issues/4320API: Should NOT operators return NULL values?2023-07-13T23:50:59ZlarsssandergreenAPI: Should NOT operators return NULL values?If you do != 5 in SQL, you'll get all rows that aren't 5, not including null values. This is the same in the API and SearchKit. I wonder if this is the desired behaviour? I would think the assumption would be that if I search for all Con...If you do != 5 in SQL, you'll get all rows that aren't 5, not including null values. This is the same in the API and SearchKit. I wonder if this is the desired behaviour? I would think the assumption would be that if I search for all Contributions where the Contribution Page is != 5, I would get all Contributions except those that have Contribution Page = 5 — but what I actually get is all Contributions that have a Contribution Page, but where that Contribution Page isn't 5.
In other words, I think you'd generally expect that if you search all Contributions where Contribution Page = 5 OR Contribution Page != 5, you'd just get all Contributions, but you only get Contributions with a Contribution Page. Obviously, your expectation might change based on your familiarity with SQL.
This is the same for NOT LIKE, NOT REGEX, and so on.
On the one hand, it's generally better to keep the behaviour of the API operators the same as SQL to avoid confusion. On the other hand, I'm having a hard time imagining a search you might want to make with a NOT that you wouldn't want to include null values, so this seems unhelpful and potentially frustrating. Is this something we should consider changing?https://lab.civicrm.org/dev/core/-/issues/4321Mailing Report link on Contact Mailings broken for A/B tests2023-05-30T22:22:24ZlarsssandergreenMailing Report link on Contact Mailings broken for A/B testsOverview
----------------------------------------
If you try to view a Mailing Report for an A/B Mailing from the Contact Mailings tab, you get unknown path instead of the mailing report. See [chat discussion here](https://chat.civicrm.o...Overview
----------------------------------------
If you try to view a Mailing Report for an A/B Mailing from the Contact Mailings tab, you get unknown path instead of the mailing report. See [chat discussion here](https://chat.civicrm.org/civicrm/pl/5rsi3a9y67dozbc8gzzmt71eic). The issue is that there is a [redirect](https://github.com/civicrm/civicrm-core/blob/cf6c1ffdcb96f45743752e451345140bdcfd7305/CRM/Mailing/Page/Report.php#L86) when the mailing report is an A/B test and that redirect does not work through [crmApp.js](https://github.com/civicrm/civicrm-core/blob/master/ang/crmApp.js) because it changes the $location, which does not work in a modal.
Reproduction steps
----------------------------------------
1. Enable Mailings for Viewing Contacts on Admin - Customize Data and Screens - Display Preferences.
1. Click Mailing Report beside an A/B test mailing on the Mailings tab on a Contact
1. Pop up says unknown path, no mailing report
Comments
----------------------------------------
Would be happy to do some work on fixing this, but I'm not sure what the approach would be.https://lab.civicrm.org/dev/core/-/issues/4322Smart groups in group tab for contact too slow2023-05-31T08:18:14ZyashodhaSmart groups in group tab for contact too slowSmart groups in group tab for contact too slow. This should be optimized.Smart groups in group tab for contact too slow. This should be optimized.yashodhayashodhahttps://lab.civicrm.org/dev/core/-/issues/4324Add Contribution Page settings for Review and Make Contribution button text2023-11-23T07:47:54ZlarsssandergreenAdd Contribution Page settings for Review and Make Contribution button textContribution Pages can be important to some organizations who do a lot of fundraising. It would be nice if the buttons were customizable, so they could say 'Donate', 'Give', 'Get Membership' or whatever the user might want.
Proposal: Ad...Contribution Pages can be important to some organizations who do a lot of fundraising. It would be nice if the buttons were customizable, so they could say 'Donate', 'Give', 'Get Membership' or whatever the user might want.
Proposal: Add two fields to Contribution Pages: review_button_text and submit_button_text. These settings could live on the main settings tab, underneath "Use a confirmation page?" with review_button_text hidden and shown conditionally. If these are populated, use these values, if not, fall back to the default (Contribute or Review your contribution followed by Make Contribution).https://lab.civicrm.org/dev/core/-/issues/4328Double opt-in requires traditional bounce handling to be enabled2023-06-28T06:55:29ZJonGoldDouble opt-in requires traditional bounce handling to be enabledOverview
----------------------------------------
The default double opt-in email says:
> You have a pending subscription to the {subscribe.group} mailing list. To confirm this subscription, reply to this email or click <a href="{subscri...Overview
----------------------------------------
The default double opt-in email says:
> You have a pending subscription to the {subscribe.group} mailing list. To confirm this subscription, reply to this email or click <a href="{subscribe.url}">here</a>.
However, "reply to this email" requires traditional bounce handling (with a bounce mailbox) to be set up. In this day and age that's less common compared to using a third party mailer that sends bounce notifications via API (to [Airmail](https://civicrm.org/extensions/airmail) or one of its many cousins).
Moreover, it's a usability issue to put "here" as the clickable text. It should be more like: "Please click here to <a href="{subscribe.url}">confirm your subscription.</a>.
I want to get concept approval - and also guidance on whether we should update existing templates or just new installs. Personally I think we should update any non-customized template.https://lab.civicrm.org/dev/core/-/issues/4332Error in membership status after a) changing membership type followed by b) p...2023-11-23T07:23:38ZJoeMurrayError in membership status after a) changing membership type followed by b) payment failure## Overview
Using a pay later payment when renewing a membership can lead to problems with the membership status, membership end date and membership type being changed at the time of the renewal being initiated ; these fields are update...## Overview
Using a pay later payment when renewing a membership can lead to problems with the membership status, membership end date and membership type being changed at the time of the renewal being initiated ; these fields are updated without a payment being recorded. It is possible that a payment will never be received, or its processing may fail. It is not easy to revert the data to its former state, or what it would have become through time from date of update to when the correction is attempted. For example, a renewal with a delayed payment might change the status from Grace to Current, the End Date from May 14, 2023 to May 14, 2024, and the Membership Type from General to Student.
These are very old problems dating to at least 2013 I believe.
The problem only occurs when both membership types have the same parent organization, and only for paid memberships. It occurs whether the membership period is Rolling or Fixed, and whether a membership type is being changed or not.
## Proposal
Refactor the current implementation so that a second, temporary membership is created that can store the new information without overwriting the old information until a payment is received for it. The new temporary membership would have a status of Pending. The Pending contribution would be related to the temporary rather than existing membership. When the payment is received (status=complete), the Pending membership's information is used to update the permanent membership, and the temporary membership record is deleted.
## Relevant code
In the Contribution Confirmation page postProcess call [legacyProcessMembership](https://github.com/civicrm/civicrm-core/blob/master/CRM/Contribute/Form/Contribution/Confirm.php#L1623), various fields are updated before the doPayment call is processed [here](https://github.com/civicrm/civicrm-core/blob/master/CRM/Contribute/Form/Contribution/Confirm.php#LL1702C42-L1702C51). As a result, the existing membership record is updated with selected membership type/end date/status after user submits a payment but before the code makes payment request, e.g. to a payment processor. This works if the payment went successfully.
In the case of a payment failure such as for IPN payment processors like Paypal Standard (occasionally when there is a delay on getting IPN callback or if the IPN response is not handled properly like https://lab.civicrm.org/dev/core/-/issues/1931) or for a manual Pay Later payment that isn't received, it leaves the selected membership in current/active state with a changed end date and possibly a different membership type. There is no fallback code written to revert the membership state or set it to Pending, and it isn't easy to reconstruct the data.
## New Behaviour
1. When initiating the Payment for Membership Renewal, create a new membership record and link the contribution in pending status to it. Add a new field, renewing_membership_id, to civicrm_membership to hold a reference from this 'temporary' pending membership to the existing membership that is being renewed. The existing membership record remains unchanged.
2. When the contribution status of the related contribution changes to Complete, update the original membership with the information from the temporary membership and delete the temporary membership.
Recommendation: delay the creation of activities for Membership Renewal (id=8), Change Membership Status (id=35) and Change Membership Type (id=36) until the contribution is completed.
Recommendation: create a new Activity Type, Membership Renewal Pending, to be created when the renewal request is received. In its body, provide: "ID of Membership being renewed: xx, Number of Periods: yy, Membership Type: [Label of Membership Type".
## Implementation:
1. Modify [here](https://github.com/civicrm/civicrm-core/blob/master/CRM/Contribute/Form/Contribution/Confirm.php#L2900), CRM_Member_BAO_Membership::getContactMembership and [here](https://github.com/civicrm/civicrm-core/blob/master/CRM/Contribute/Form/Contribution/Confirm.php#L2939).
2. Add / update new / existing unit tests on these new scenarios.EdselopezEdselopezhttps://lab.civicrm.org/dev/core/-/issues/4334Remove Event Info link from Manage Event (and same from Manage Contribution P...2023-06-21T14:55:10ZlarsssandergreenRemove Event Info link from Manage Event (and same from Manage Contribution Page)![image](/uploads/dd822bae24450b2001a604f392198a89/image.png)
I'm not sure this is needed, since it just replicates the link available in the Event Links above, except less completely, as it doesn't include Online Registration, so users...![image](/uploads/dd822bae24450b2001a604f392198a89/image.png)
I'm not sure this is needed, since it just replicates the link available in the Event Links above, except less completely, as it doesn't include Online Registration, so users tend to think this is the only option (some organizations do not use Event Info, preferring to link straight to Registration).
There is a similar thing at the bottom of the first Manage Contribution Page tab that could also be removed, in my opinion. These look kind of weird and aren't really necessary, so I think they can go without losing anything, but am looking for further opinions on this.https://lab.civicrm.org/dev/core/-/issues/4336Payment on Event Confirmation Page: Does not work when pay later is disabled2023-06-09T18:39:49ZlarsssandergreenPayment on Event Confirmation Page: Does not work when pay later is disabledGreat to have this functionality!
_This has been updated after the fixes in PR 26491._
_There are two cases: 1) with pay later or 2) without pay later._
**If pay later is enabled**, it seems to work as intended, but the pay later inst...Great to have this functionality!
_This has been updated after the fixes in PR 26491._
_There are two cases: 1) with pay later or 2) without pay later._
**If pay later is enabled**, it seems to work as intended, but the pay later instructions are displayed on the payment/confirmation page (they should never be as the user hasn't selected a payment method yet) and on the Thank You page even if they selected another payment method (see screenshots below).
Updated: After submitting, the contribution is created, but it is set to pending (pay later) and no payment is present.
With pay later enabled, it looks like $is_pay_later is always true.
On payment/confirmation:
![image](/uploads/1c406bf9b01bcaa4a430f3d720b5bf7f/image.png)
On Thank You after selecting a payment method that isn't pay later:
![image](/uploads/e2630c45369dbf975ad340c83339b7ec/image.png)
**Without pay later:**
On the payment/confirmation page, something isn't loading right because these billings fields should be filled in and there shouldn't be a card type select:
<img src="/uploads/546c468287908dc976a3e47a73192aed/image.png" width=400>
On submit, we get an error:
` [error] Payment processor exception: Error Unexpected Server Error, please see your logs `
```
[info] $iATS SOAP Response = stdClass Object
(
[ProcessCreditCardResult] => stdClass Object
(
[any] => FailureObject reference not set to an instance of an object.
)
)
```
Fixed:
~~On the first page, with pay later disabled, we get divs that shouldn't be there:~~
<img src="/uploads/cb6e5ac305cc947cb404206fecc5899d/image.png" width=400>https://lab.civicrm.org/dev/core/-/issues/4339Add hook for member userdashboard for altering results2023-06-09T07:48:14ZyashodhaAdd hook for member userdashboard for altering resultsAdd hook for member userdashboard for altering resultsAdd hook for member userdashboard for altering resultsyashodhayashodhahttps://lab.civicrm.org/dev/core/-/issues/4340Fix behavior of summary action hook2023-06-09T07:48:33ZyashodhaFix behavior of summary action hookFix behavior of summary action hook to make it indeed useful. The hook needs to called for manipulation at the very last. The hook is being called early and then all the sorting etc takes place, rendering it useless.Fix behavior of summary action hook to make it indeed useful. The hook needs to called for manipulation at the very last. The hook is being called early and then all the sorting etc takes place, rendering it useless.yashodhayashodhahttps://lab.civicrm.org/dev/core/-/issues/4341Users without batch permissions may create and run batches2023-06-09T08:53:44ZGavin SmalleyUsers without batch permissions may create and run batchesOverview
----------------------------------------
Users without permission to create batches can not only create batches but also validate and run them.
Reproduction steps
----------------------------------------
1. From a default insta...Overview
----------------------------------------
Users without permission to create batches can not only create batches but also validate and run them.
Reproduction steps
----------------------------------------
1. From a default install of CiviCRM in WordPress access the "WordPress Access Control" page
2. For a given userclass remove all of the following permissions:
- CiviCRM: create manual batch Create an accounting batch (with Access to CiviContribute and View Own/All Manual Batches)
- CiviCRM: edit own manual batches Edit accounting batches created by user
- CiviCRM: edit all manual batches Edit all accounting batches
- CiviCRM: close own manual batches Close accounting batches created by user (with Access to CiviContribute)
- CiviCRM: close all manual batches Close all accounting batches (with Access to CiviContribute)
- CiviCRM: reopen own manual batches Reopen accounting batches created by user (with Access to CiviContribute)
- CiviCRM: reopen all manual batches Reopen all accounting batches (with Access to CiviContribute)
- CiviCRM: view own manual batches View accounting batches created by user (with Access to CiviContribute)
- CiviCRM: view all manual batches View all accounting batches (with Access to CiviContribute)
- CiviCRM: delete own manual batches Delete accounting batches created by user
- CiviCRM: delete all manual batches Delete all accounting batches
- CiviCRM: export own manual batches Export accounting batches created by user
- CiviCRM: export all manual batches Export all accounting batches
3. Create a user for that userclass and login
4. Click "Batch Data Entry" from the Memberships menu
5. Create a batch and press validate.
Current behaviour
----------------------------------------
The batch will run.
Expected behaviour
----------------------------------------
If the user has none of the permissions above they should not be able to create, validate or run a batch.
Environment information
----------------------------------------
* __Browser:__ _Chrome Version 114.0.5735.90 (Official Build) (64-bit)_
* __CiviCRM:__ _5.52.2_
* __CMS:__ _WordPress 6.0.5_
Comments
----------------------------------------
The user can also "save for later" but can never access those saved batches again, as they are (quite correctly) prohibited from seeing the list.https://lab.civicrm.org/dev/core/-/issues/4342It should be possible to remove a hidden smart group from recipients of a mai...2023-06-28T06:56:18ZlarsssandergreenIt should be possible to remove a hidden smart group from recipients of a mailing that has been copiedIf you create a mailing by copying another mailing that was sent to search results, it is impossible to remove the hidden smart group from the recipients of your new mailing. This can be frustrating, because your intent in copying a mail...If you create a mailing by copying another mailing that was sent to search results, it is impossible to remove the hidden smart group from the recipients of your new mailing. This can be frustrating, because your intent in copying a mailing may not have been to send it to the same contacts, rather to re-use the content. With Mosaico, you can't easily duplicate the content, so this is a pain.
Ideally, hidden smart groups would be mandatory for the original mailing and could be removed for copies. However, that isn't possible because mandatory groups are simply [included groups that are hidden](https://github.com/civicrm/civicrm-core/blob/f0648c892ab4795b9bec873c840e06009ea4800a/ang/crmMailing/BlockRecipients.html#L6).
Options I see:
1. Don't include hidden groups when copying a mailing. Would solve this issue, but then some users are going to expect identical recipients when they copy a mailing because they are copying the mailing in order to resend to the same recipients, changing the content.
1. Add a Copy without recipients option. This seems like it would add UI complexity for something pretty specific.
2. Allow hidden smart groups to be removed from mailings in general, with a confirmation. This feels like the best option to me. Maybe I've started a mailing from search results and later decide I don't want to send it to those search results. Clearly we want to prevent users from removing a hidden group by accident, but as an intentional decision the user confirms, I think this makes sense. Would have to look at how to handle the unsubscribe group in this case.https://lab.civicrm.org/dev/core/-/issues/4344SearchKit: Register Participants for Event is missing from Actions2023-10-21T14:28:40ZlarsssandergreenSearchKit: Register Participants for Event is missing from ActionsUnfortunately, Register Participants for Event isn't available in SK because CRM_Event_Form_Task_Register doesn't work in [standalone mode.](https://docs.civicrm.org/dev/en/latest/searchkit/tasks/#legacy-search-tasks
)
I think this is t...Unfortunately, Register Participants for Event isn't available in SK because CRM_Event_Form_Task_Register doesn't work in [standalone mode.](https://docs.civicrm.org/dev/en/latest/searchkit/tasks/#legacy-search-tasks
)
I think this is the most important missing action by far. Is there a plan on how we transition this to work in SK? I can put some work into it, but don't understand what needs to happen exactly.
From @petednz's question on [chat](https://chat.civicrm.org/civicrm/pl/d66yto1ewp8s5ra5qs94hurk6r), but this is something I've run into a few times.https://lab.civicrm.org/dev/core/-/issues/4346Find Groups improvements2023-06-09T07:50:00ZyashodhaFind Groups improvementsThe idea is to give more insight into the parents and children of the said group. It's hard to understand the complexity of the group in the current UI esp in the scenarios where the smart groups are heavily used.
I am proposing this c...The idea is to give more insight into the parents and children of the said group. It's hard to understand the complexity of the group in the current UI esp in the scenarios where the smart groups are heavily used.
I am proposing this change which should help significantly by adding these 2 columns to the listing :
- Parent - Add parent column which shows parents count which is a url when clicked lists all parents groups
- Children - Add children column which shows children count which is a url when clicked lists all child groupsyashodhayashodhahttps://lab.civicrm.org/dev/core/-/issues/4349Migrate "Edit Profile" popup to SearchKit/FormBuilder, kill BackBone2023-06-09T09:14:03ZcolemanwMigrate "Edit Profile" popup to SearchKit/FormBuilder, kill BackBoneCiviCRM includes an entire javascript framework stack, Backbone + Marionette, and only uses it to do one thing: the "Edit Profile" popup.
It wouldn't be quite the same, but I think we could make something equivalent *enough* using Search...CiviCRM includes an entire javascript framework stack, Backbone + Marionette, and only uses it to do one thing: the "Edit Profile" popup.
It wouldn't be quite the same, but I think we could make something equivalent *enough* using SearchKit and Afform and kill off Backbone once and for all.https://lab.civicrm.org/dev/core/-/issues/4351Auto Complete Field doesn't exist in FormBuilder2023-08-14T00:32:03ZtreseroAuto Complete Field doesn't exist in FormBuilderIf you have a custom field that is an autocomplete multiple values, formbuilder won't address that. It appears that single selects are the only option for forms.
Here is an example:
I have contacts, and added information is additional c...If you have a custom field that is an autocomplete multiple values, formbuilder won't address that. It appears that single selects are the only option for forms.
Here is an example:
I have contacts, and added information is additional casts traveled in.
In the backend contacts edit, no problem, you can add multiple casts per contact.
![image](/uploads/00c5f87c0bcad9996efeac0134915317/image.png)
But in a form you only can use a select, not multiselect and it doesn't inherit from the base.
![image](/uploads/ef486051db6560a9dbfa98c7c17718bb/image.png)
Therefore, members can't update their casts with multiple casts.https://lab.civicrm.org/dev/core/-/issues/4354Activities created via API should notify Assignees2023-08-03T12:38:52Zwil_SRQActivities created via API should notify AssigneesOverview
----------------------------------------
If the GUI (https://cc.unidosnow.org/civicrm/activity?action=add) would notify assignees when an activity is created. It'd be useful for the API to do so too. The GUI respects the setting...Overview
----------------------------------------
If the GUI (https://cc.unidosnow.org/civicrm/activity?action=add) would notify assignees when an activity is created. It'd be useful for the API to do so too. The GUI respects the setting in Administer > Customize Data and Screens > Display Preferences > Notify Activity Assignees and notification rules by Activity type. It'd be useful for the API to do so too.
Example use-case
----------------------------------------
1. Invoke civicrm_api3('Activity', 'create', []) or civicrm_api4('Activity', 'create', [])
2. Include assignees
Current behaviour
----------------------------------------
The Activity is created but the assignees are not notified, even in situations where creating the equivalent activity via the GUI would have issued notifications.
Proposed behaviour
----------------------------------------
Notify assignees using the same rules and notification format as the GUI.
Comments
----------------------------------------
See https://civicrm.stackexchange.com/q/45078/5446
Workaround is to call CRM_Activity_BAO_Activity::sendToAssignee() separatelyhttps://lab.civicrm.org/dev/core/-/issues/4356(Exploration) Replace AngularJS with `$XXX`2023-07-28T00:09:29Ztotten(Exploration) Replace AngularJS with `$XXX`(*This document was written for a technical audience -- people who are familiar with many technologies, who want to bring them to Civi, and who find themselves asking, "Why can't we have nice things?" It was initially drafted as private ...(*This document was written for a technical audience -- people who are familiar with many technologies, who want to bring them to Civi, and who find themselves asking, "Why can't we have nice things?" It was initially drafted as private document;
then shared during the Manchester 2022 sprint as a [gist](https://gist.github.com/totten/5c34e3885a4fe7002f990e09395b4294). By request, it's now copied to the issue-tracker so that we have a more familiar discussion-space and reference-id. I've made
a few small edits and documented one more of the challenges, but the substance is largely the same.*)
# Table of Contents
[[_TOC_]]
# Preliminaries
## Why replace AngularJS?
* The upstream "AngularJS" project (*a Javascript framework*) re-made itself as "Angular" (*a Typescript framework*).
* This reflects important changes in the platform, and it is not a straight-forward upgrade. Adopting newer "Angular" versions should be approached as a *migration*.
* The upstream "AngularJS" project has been proclaiming: "We don't like our JS product anymore. Don't use that."
* One original goal of adopting "AngularJS" was to get some bandwagon benefits. Those benefits are no longer there.
## What is "$XXX"?
`$XXX` is a stand-in for "Angular 14 or ReactJS or some other client-side page-rendering system". The specific value is a matter for consideration.
Some migration issues are generally applicable to any alternative, and we may use `$XXX` as stand-in (because it gets tiresome to write "Angular 14 or ReactJS or some other client-side page-rendering system").
## What is CiviCRM?
For purposes of this evaluation, CiviCRM is an ecosystem -- a collection of packages developed and maintained by many people. It includes a significant core package and a significant set of extensions. If we adopt `$XXX`, then we ae encouraging this ecosystem to write their screens and UI components with `$XXX`.
Today, CiviCRM's ecosystem is quite varied:
* You have `civicrm-core` -- which includes the framework, several common business modules, APIs, and various UIs for admins+staff+consumers.
* You have extensions like CiviVolunteer or CiviGrant -- which define new business modules (including their APIs and UIs).
* You have extensions like CiviRules or Search Kit -- which build generic functionality (that works with many business modules).
* You have extensions like Mosaico or CiviDiscount -- which significantly improve the features of an existing business-module.
* You have extensions like AngularProfiles or Email API -- which add extra building-blocks or fill-in gaps.
* You have bespoke extensions for specific sites -- extensions which fine-tune screens, workflows, settings, for a specific organizational context.
Each package may define some mix of:
* Redistributed artifacts (like CSS files, APIv3 files, APIv4 files, Smarty templates, etc) curated by developers.
* Local artifacts (like Profiles and SavedSearches and Webforms and Afforms) curated by administrators for a specific site (with support from the extensions).
These packages are distributed in various ways, eg:
* Published as part of `civicrm-core`
* Published in a public directory for impromptu download/installation
* Organized as in-house collections
Is this the optimal shape for the ecosystem? I'm not sure how you would answer that.
Instead, for this discussion, I simply accept this shape for the ecosystem. CiviCRM's ecosystem should continue to have similar kinds of packages and similar kinds of distribution -- even if some specific packages change, and even if it adopts another tool like `$XXX`. This shape is not perfect or static - but it is realistic and representative.
# Challenges
Perhaps we just drop-in some new files for the latest version of Angular? Or, failing that, drop-in ReactJS? Surely, at the end of the day, these are JS files used by the browser. You just need to put them on a web-server. The browser will run them, and that's it. What's wrong with that?
Let's break-down a few specific challenges.
* Linker-Loader and Modularity
* Angular 14 and TypeScript
* ReactJS and JSX
The challenges can be *addressed* -- the question is what *trade-offs, costs, or compromises* we accept.
## Linker-Loader and Modularity
### Definition
Sane software is built in pieces. To run the software, you have to put the pieces together. This requires a linking or loading mechanism.
Just to clarify what I mean, let's use a basic example. Here we have some classes for an application where the user draws rectangles on a canvas:
```js
// FILE: Canvas.js
class Canvas {
constructor() {
// A list of visual objects to display in this presentation
this.objects = [];
}
addRectangle(x, y, width, height) {
this.objects.push({
pos: new Coordinate(x, y),
obj: new Rectangle(width, height)
});
}
}
```
```js
// FILE: Rectangle.js
class Rectangle {
constructor(width, height) {
this.width = width;
this.height = height;
}
}
```
```js
// FILE: Coordinate.js
class Coordinate {
constructor(x, y) {
this.x = x;
this.y = y;
}
}
```
N.B. To use `Canvas`, you must also use `Rectangle` and `Coordinate`. There must be a mechanism to say: "*We are loading `Canvas.js` and also `Rectangle.js` plus `Coordinate.js`.*"
If you're reading this, then I'm sure you're already familiar with several such mechanisms, though they go by many names. Perhaps you've encountered PHP's "autoloader"; Javascript's "webpack"; bash's "PATH"; C's "static-linking" and "libtool". All of these address the need to combine/resolve related pieces of software.
The design of the link-load mechanism can have effects on:
* Performance - Load times, download sizes, cache efficacy, update frequency, etc. (*A link-load mechanism that performs nicely for small apps might perform badly for large apps, and vice-versa.*)
* Workflow - The ease or difficulty of installing, developing, customizing, upgrading, etc.
* Modularity - How you design/frame/distribute the packages of the system.
In the phrase "link-load", I wish to evoke the general mechanism of "getting the stuff we need" -- with an understanding that different systems have different phrases, tools, and flows.
### What kind of linking/loading does CiviCRM require?
Recall that the CiviCRM ecosystem has a mix of extensions providing different kinds of value (*business modules, APIs, UIs, etc*) with various artifacts (*CSS files, APIv4 files, Quickform files*). If we adopt `$XXX`, then `$XXX` will provide more kinds of artifacts (*JS-based pages; Angular components; React components; etc*). You should be able to define these in Civi extensions. Thus, you might create files like:
```
## Angular component defined in core on Drupal 9
/var/www/vendor/civicrm/civicrm-core/ang/*.component.ts
## React component defined in an extension on Drupal 7
/var/www/sites/default/files/ext/myextension/react/*.jsx
```
The linker/loader mechanism used for `$XXX` in CiviCRM should be able to:
* Load screens defined by core+extensions.
* Load components defined by core+extensions (across extension boundaries).
* Load transitive dependencies required by the screens+components in core+extensions (across extension boundaries).
### What does linking/loading look like in Javascript?
Javascript is a big ecosystem! And it's been around for 25 years. We will not try to discuss all the techniques of the many applications/frameworks/tools. Rather, let's note a couple relevant practices - the baseline; the current mechanisms in CiviCRM; and the mechanisms favored in contemporary Angular+React ecosystems.
First, as a baseline, the traditional mechanism (*available to all web developers since 1995*) is to write HTML: you create a webpage with a list of `<script>` tags containing URLs of all your JS files.
```html
<head>
<script type="text/javascript" src="./js/Rectangle.js"></script>
<script type="text/javascript" src="./js/Coordinate.js"></script>
<script type="text/javascript" src="./js/Canvas.js"></script>
</head>
```
This is (roughly) how JS files get into CiviCRM's PHP screens - except that the `<script>` tags are written as PHP statements (`addScriptFile($ext, $file)`). But it's similar: it's a top-level list of JS files, and they're printed as a list of `<script>` tags in the main HTML document. On a case-by-case basis, some screens make extra calls to `addScriptFile`/`<script>`.
CiviCRM's AngularJS screens use another mechanism -- a *dependency-graph*. It works as follows:
* Each major Angular module has an explicit metadata file (`*.ang.php`) with a list of inputs and outputs (components/tags/etc).
* If a site-builder/developer makes a custom form (`*.aff.html`), then we scan the HTML and infer its dependencies (based on the tags and attributes).
* When a user requests an Angular-based screen (eg `civicrm/admin/search`), then we use this metadata to identify dependencies and send them all as a bundle.
In contemporary Angular and ReactJS ecosystems, it is also conventional to use a dependency-graph -- but now based on *ES6 modules*. ECMAScript 6 defines *a language-level standard* with `import`/`export` statements. For example, `Canvas.js` could be updated to:
```js
// FILE: Canvas.js
import { Coordinate } from 'Coordinate.js';
import { Rectangle } from 'Rectangle.js';
export class Canvas {
constructor() {
// A list of visual objects to display in this presentation
this.objects = [];
}
addRectangle(x, y, width, height) {
this.objects.push({
pos: new Coordinate(x, y),
obj: new Rectangle(width, height)
});
}
}
```
For pure JS development, this represents a significant improvement over the baseline -- you do not need to maintain a global list of scripts. You don't need custom metadata (like `*.ang.php`). You describe the JS dependencies within the JS files. And unlike Civi's AngularJS loader, this mechanism is a widely known standard. ES6 modules have become nearly ubiquitous in documentation for contemporary JS libraries.
### Challenges of linking/loading for Javascript
ES6 `import`s are part of the language standard, but you cannot take this mechanism for granted. There are multiple implementations with important differences. To see this, let's do an example.
Suppose you are writing an extension like "Mosaico" which builds on top of CiviMail. You need to use a (Angular/React/etc) component from CiviMail. So you `import` it:
```js
import ReceipientSelector from '../../../sites/all/modules/civicrm/components/Mailing/RecipientSelector.js';
const MosaicoEditor = () => <div>....<ReceipientSelector />...</div>;
export default MosaicoEditor;
```
This import (*with a physical path*) is compatible with most implementations of `import`, but the path itself is untenable -- it will only work on (say) 50% of CiviCRM deployments. For broad support, you need to hide some of these physical details and use a simpler (logical) path -- such as:
```diff
-import ReceipientSelector from '../../../sites/all/modules/civicrm/components/Mailing/RecipientSelector.js';
+import ReceipientSelector from 'civicrm/components/Mailing/RecipientSelector.js';
```
This can be done - and I suspect that most pure-JS apps benefit from simpler expressions. However, this depends on *the particular implementation* of `import`. Implementations fall into a few major groups:
* _Browsers_: Since [~2019](https://caniuse.com/mdn-javascript_operators_import), most major web-browsers have had support for `import`s with physical paths. However, support for [logical paths ("import maps")](https://github.com/WICG/import-maps) is [gradually rolling out](https://caniuse.com/import-maps). At time of writing, Chrome has support; Firefox requires an experimental opt-in (`about:config`); and Safari has no support. ([There may be a polyfill](https://github.com/systemjs/systemjs/blob/main/docs/import-maps.md).)
* _Bundlers_: Bundlers (like `webpack` or `rollup`) have provided support for a longer period, and they appear in many web-app project-templates. Bundlers scan JS code, examine `import`s, and build aggregated JS files. They have more features -- such as customized path resolution and build-optimizations ("minification", "tree shaking"). However, most (all?) popular bundlers are designed for NodeJS.
(*Question: Is the choice of `import` mechanism all-or-nothing? Or do they interoperate? For example, suppose you use `webpack` to make a base-bundle `$XXX + common widgets` -- and then you load a few extra JS modules in the browser. Will `import`s in the browser find resources from `webpack`'s bundle?*)
### Approaches to linking/loading ES6 for CiviCRM
1. Don't support ES6 modules
* _Pro_: No new code!
* _Con_: You will find it confusing to read documentation+examples in the `$XXX` ecosystem. Authors tend to assume you have figured out ES6. (*If you read `import foo from bar.js`, then you will need to mentally substitute calls like `addScriptFile('bar.js')`.*)
* _Con_: Some libraries may be difficult/impossible to assimilate (*because the code is sprinkled with unresolvable `import`s*).
1. Rely on browser support. All `import`s in Civi-land use physical paths. Rearrange Civi.
* _How_: Rearrange the file-tree (for every Civi-CMS integration) to make physical paths cleaner and more predictable.
* _Pro_: Clean, predictable paths are pleasant.
* _Pro_: Standards-based `import` mechanism. No special tools/libraries.
* _Con_: Major compatibility break with existing CiviCRM deployments/hosts/scripts.
* _Con_: Doesn't support bundling/aggregation.
1. Rely on browser support. All `import`s in Civi-land use physical paths. Sync files during installation.
* _How_: Define a data folder like `[civicrm.files]/js`. Whenever you install/upgrade/remove an extension, synchronize the JS resources to this folder -- and ensure that each file lands in a clean/predictable subdir. The web-browser requests JS files from `[civicrm.files]/js`.
* _Pro_: No major compatibility break.
* _Pro_: Clean, predictable paths are pleasant.
* _Con_: Large file sync's are unpleasant (especially during development).
* _Con_: Doesn't support bundling/aggregation.
1. Rely on browser support. All `import`s in Civi-land use import-maps.
* _How_: In PHP, define a registry of import-paths. Fill this based on the list of installed extensions. Output the `import-map` to the HTML `<HEAD>`.
* _Pro_: Works with existing file-tree.
* _Pro_: Standards-based `import` mechanism. No special tools/libraries.
* _Con_: Firefox+Safari support is... eh... "pending". *There may be a polyfill (not yet assessed).*
* _Con_: Doesn't support bundling/aggregation.
* _Comment_: If we think that Firefox+Safari will have good support in (say) 2023, then we could proceed down this path and simply keep this functionality in "alpha" until 2023.
1. Rely on a bundler. Every extension calls the bundler on its own.
* _How_: In each extension that uses `$XXX` for a UI, define `package.json` (et al) to download a bundler (eg `webpack`) and build a custom bundle. To include resources from another extension, ask Civi for the paths (eg `cv path -x $EXT`). Publish the compiled bundle as part of the extension.
* _Pro_: Use a popular bundler with advanced features (like tree-shaking).
* _Pro_: Each extension developer can choose their own bundler. (Freeedom!!)
* _Con_: All such extensions will have independent versions of `$XXX` (and independent versions of common utilities/widgets/etc).
* _Con_: Upgrades/bugfixes are onerous (*must upgrade every extension; they're all statically-linked*).
* _Con_: If you have a screen (e.g. "The Dashboard") that mixes elements from multiple extensions, then you will get multiple copies of `$XXX`.
* _Con_: Impossible for one extension to add to another extension (*eg CiviDiscount adding elements to CiviEvent*).
* _Con_: Strange bootstrap process (*similar to `civicrm_generated.mysql`; you need a working Civi deployment with the extension enabled before you can write the `*.js` file that will be redistributed.*)
1. Rely on a bundler. Integrate a popular bundler (like `webpack`/`rollup`) into Civi. Run it whenever you install/upgrade/remove extensions.
* _How_: Make a JS script which calls `webpack` (etc). Pass key configuration-data (e.g. the list of bundles and JS files) from Civi to `webpack`.
* _Pro_: Use a popular bundler with advanced features (like tree-shaking).
* _Pro_: Works with existing file-tree.
* _Con_: Requires JS runtime -- eg `node` subprocess, `node` daemon, or browser-based queue-worker.
* _Con_: Vendor-specific `import` mechanism.
* _Con_: No dynamic bundling (*based on user-defined forms, settings, etc*)
1. Rely on a bundler. Use/improve a PHP-based bundler for JS files.
* _How_: There's an alpha-stage JS bundler at https://bitbucket.org/fugu-fuman-library/es6bundler/src/main/. Add it to core. As necessary, contribute to it.
* _Pro_: Works with existing source-tree.
* _Pro_: Supports bundling
* _Pro_: Supports dynamic bundling (*based on user-defined forms, settings, etc*)
* _Con_: It's alpha-stage with no major user-base. It likely needs work.
* _Con_: There is not much of an ecosystem for parsing JS in PHP. You're likely to use approximations (regex) or something slow.
* _Con_: Limited optimizations (Never as good as `webpack`. Ex: You can do minification but not tree-shaking.*)
* _Con_: Vendor-specific `import` mechanism.
1. Rely on 2-step bundler. Use JS to build dependency graph. Use PHP to concatenate final bundle(s).
* _How_: If an extension publishes JS files, then it should also publish a JSON index (listing the files+dependencies). Provide JS devtool to generate the index. In Civi, use the PHP bundler.
* _Pro_: Works with existing source-tree.
* _Pro_: Supports bundling
* _Pro_: Supports dynamic bundling (*based on user-defined forms, settings, etc*)
* _Pro_: JS scanning is done by JS code (*should be able to find a robust JS parser*)
* _Con_: No one else is doing it.
* _Con_: Need to include JS indexer as part of extension-development workflow.
* _Con_: Limited optimizations (Never as good as `webpack`. Ex: You can do minification but not tree-shaking.*)
* _Con_: Vendor-specific `import` mechanism.
## Angular, TypeScript, ng
Angular 14 appears to parallel the original AngularJS in that it has two main file-types:
| Version | Logic/Behavior-Implementation | Layout/Component-Graph |
| -- | -- | -- |
| AngularJS | Javascript (`*.js`) | XHTML (`*.html`) |
| Angular | Typescript (`*.ts`) | XHTML (`*.html`) |
The good news is that the layout/component-graph is broadly the same format - HTML provides the canvas for organizing the choice of components that you want on the screen. This canvas still uses a well-known format which is amenable to reading/filtering/writing with _many_ tools. This gives us a good prognosis for migrating data (*immediately*) and maintaining it (*future updates*).
But... the logic/behavior files changed to Typescript. This requires a TypeScript compiler. Like with linker-loader, the compiler needs to be taught to load classes from different extensions (*ie the type-checker needs full visibility on the list of types - and types can originate in different places*).
I haven't examined of how Angular 14 implements its compiler/linker/loader mechanisms, so the list of approaches here is nowhere near as detailed as the link-loader discussion above. But loosely, the documented/supported mechanisms are built around a CLI tool named `ng` (*implemented with `node`*). The general options appear to be:
* Integrate with `ng`. (This will have similar pro/con as the integrating with the webpack bundler.)
* Examine+decompose the functionality of `ng`. It may be possible to combine this with one of our linker-loader approaches.
* Don't support TypeScript at all. (This will likely be very difficult. It's true that earlier versions of Angular presented JS options, and it's true that Angular compiles down to JS, but contemporary documentation is exclusively geared toward TS. Even if we figure out how, they're liable to change it.)
The adoption of `ng` represents another significant change between AngularJS and contemporary Angular. This is likely very nice for people who write pure-Angular applications -- the `ng` tool provides more functionality and hides more details. Thus, they can make big changes in the mechanics (eg [switching from "Just in Time" compilation to "Ahead of Time" compilation](https://angular.io/guide/aot-compiler)) without significantly changing the DX. But I worry about the breadth of `ng`'s scope -- that your choice is to either (a) do everything "the ng way" or (b) continuously reengineer your process to stay aligned with `ng`.
I have a theory (*but can't fully back it up, as I haven't been following along with Angular 2+ closely*) -- by introducing `ng`, Angular began asserting more ownership over the stack+workflow. This has probably helped pure-Angular development work (because lots of changes can be encapsulated within `ng`) -- but it's has made it harder to integrate with other applications (like Civi and the CMSs). It doesn't seem like a coincidence that AngularJS (*JS library*) had a fairly long/stable 1.x series -- while Angular (*Typescript platform*) has done frequent major-version bumps.
## ReactJS and JSX
(*Sketch/Notes*)
* The graph of ReactJS components is defined as a series of JS functions. These functions can be written in pure JS, but they are typically written in "JSX" (JS with inline HTML).
* From POV of an HTML developer, the extra power of JSX is that it provides a full (Turing complete) language -- where you can mingle function calls, loops, etc.
* From POV of a JS developer, the extra ease of JSX is that embeds HTML (rather than using verbose DOM calls).
* These things are exactly what makes it hard to process in other ways -- eg if the component-graph is defined with JS function-calls, then you're tooling must model "JS function-calls".
* To provide __tooling__ around JSX, you need the ability to compile/parse/generate JSX (aka "encode/decode"; aka "use the abstract syntax tree (AST)").
* Here are some of the things that would require AST/encode-decode capability:
* Drag/drop editor (let a web-user compose the graph of widgets)
* Incremental-upgrades (automatically swap deprecated code with supported code)
* Make client+server logic match-up (use the same document to determine entity-bindings and validations)
* The standard tooling for JSX (compilers/parsers/ASTs) are implemented in JS themselves. But if the server and dev-workflow are in PHP, then you have to either (a) live with constrained callouts between PHP+JS or (b) reimplement JSX tooling in PHP.
* Generally, to support more tooling+workflows, you want a standardized notation such as XML or JSON.
* It is possible to use ReactJS *only* as a runtime (*in the same sense that Civi Profiles (`UFGroup`s) use Quickform as the runtime*).
* You might do this if you want to get some part of ReactJS (e.g. pure-functional code-style; e.g. branding) but don't need "native feel".
* ReactJS without JSX is not the "ReactJS experience". For a developer who's experienced in ReactJS, it will _feel_ alien.
* One example: ["HTM"](https://github.com/developit/htm) is a different templating language that also produces React components. HTM relaxes some of workflow
requirements (e.g. no need for transpiler). However, HTM (specifically) still has similar tooling+AST issues as JSX.
## Walk and/or Chew Gum
Broadly speaking, there is a tension between:
* (a) Providing value to users -- i.e. improving utility/functionality of SearchKit and Form Builder. We have some momentum and regular investment, and we're in the middle of converting existing screens to the newer stack (e.g. `civicrm_admin_ui`). We don't want to kill this.
* (b) Replacing AngularJS -- i.e. migrating to Angular(TS) or ReactJS or similar. This could be as a difficult as a rewrite. If you do a straight-conversion, that's a high-bar -- you may be stuck with a project that cannot be released for 12-18 months. Or you may be stuck with two parallel versions, where the new one never reaches completion.
The challenge is to navigate that tension in a realistic way. It seems unrealistic to stop all improvements for a year. It also seems unrealistic to stay on AngularJS permanently. So how do you address both goals?
To my mind, the most promising concept so far looks roughly like this:
* Take our current data-formats of SK/FB. Formalize them -- define schemas with version-numbers, add enforcement mechanisms (warnings/migrations).
* The data-formats require runtime-interpreters. We currently have one based on AngularJS. We seek to add one based on `$XXX`.
* Gradually phase-out the AngularJS interpreter; gradually phase-in the `$XXX` interpreter. Site-builders and extension-developers use
this data-format throughout the transition.
Here's an example of an incremental transition:
* __Definitions__:
* SKFB-A is the SearchKit/FormBuilder runtime on Angular.
* SKFB-X is the SearchKit/FormBuilder runtime on `$XXX`.
* __Incubation Period__:
* SKFB-A is default. All stable/released functionality is based on SKFB-A.
* SKFB-X is undergoing primary development. You can opt into it (e.g. toggle a flag or extension).
* The format may still undergo small revisions which are implemented/supported by SKFB-A.
* __Sync-Up Period (Soft Freeze)__
* The format is in soft-freeze. Features shouldn't be added (unless doing so helps to achieve the sync-up).
* SKFB-A is default. It may get small bug-fixes.
* SKFB-X is the focus of development attention. The aim is to achieve compatibility with current FMT and most screens.
* __Wind-Down Period__:
* SKFB-X is used for all user-generated screens and many built-in screens.
* SKFB-A is still available - and is used transitionally for screens that require it.
* The format is unfrozen. It may continue to evolve on SKFB-X.
* __Other Considerations__:
* Throughout the process, both SKFB-A and SKFB-X are developed in `civicrm-core.git`.
* Throughout the process, downstream site-builders and developers (of other extensions) may continue to use FMT define screens.https://lab.civicrm.org/dev/core/-/issues/4357Timezone with Drupal 9, CiviCRM entity and Views2023-12-23T00:55:25Z5knotsTimezone with Drupal 9, CiviCRM entity and ViewsOverview
----------------------------------------
We are working with grants, where fields like "money transferred" exist. This field is stored in the database as a "date-only" value (screenshot). However, Drupal interprets the date as a...Overview
----------------------------------------
We are working with grants, where fields like "money transferred" exist. This field is stored in the database as a "date-only" value (screenshot). However, Drupal interprets the date as a datetime field and, presumably, sets the time to 12 noon, but a day before. This leads to inconsistent dates in Drupal Views outputs. Is there a known workaround to avoid this issue? Currently, I have set a fixed 12-hour timezone difference for the View, which works but is not an ideal solution.
Reproduction steps
----------------------------------------
1. Install civicrm entity and enable grants
1. go to Drupal Views and create a new view based on grants.
1. include fields like 'money transferred'
Current behaviour
----------------------------------------
Drupal interprets the date as a **datetime** field.
Both attached screenshots are from the same entry.
![Bildschirmfoto_2023-06-13_um_14.41.49](/uploads/6b7df46f1fdd9354238c4e4e90ce0dec/Bildschirmfoto_2023-06-13_um_14.41.49.png)
![Bildschirmfoto_2023-06-13_um_14.43.32](/uploads/e324ce91d7fe2a48a0ce84c4bb580589/Bildschirmfoto_2023-06-13_um_14.43.32.png)
Expected behaviour
----------------------------------------
Drupal interprets the date as a **date** field.
Environment information
----------------------------------------
D9.5, CiviCRM 5.62, civicrm_entity /latesthttps://lab.civicrm.org/dev/core/-/issues/4358Verbiage changes on Find Groups screen2023-08-17T17:50:18ZyashodhaVerbiage changes on Find Groups screenPropose to make following changes on Find Groups.
- Change Type to Usage. We now have Type : Access Control /Mailing List
and Group Type as Normal Group / Smart Group. The type is more of a usage (used for Access Control /Mailing List)...Propose to make following changes on Find Groups.
- Change Type to Usage. We now have Type : Access Control /Mailing List
and Group Type as Normal Group / Smart Group. The type is more of a usage (used for Access Control /Mailing List), so make the changes all across the Settings screens in addition to search results/filter.
- Change Normal Group to Regular Group. Well because there's nothing abnormal about the smart groups :)yashodhayashodhahttps://lab.civicrm.org/dev/core/-/issues/4361Add Pay now link to Invoice template2023-06-28T06:58:22ZlarsssandergreenAdd Pay now link to Invoice templateIt would be nice to have the link to pay online included in the Invoice template. Currently, a user would have to guess this is possible, find the correct link on SE and add it to the template (then maintain it as the template is updated...It would be nice to have the link to pay online included in the Invoice template. Currently, a user would have to guess this is possible, find the correct link on SE and add it to the template (then maintain it as the template is updated).
I think if default_invoice_page is set, we could simply include a Pay Now link in the Payment Advice section (which is only shown if the Contribution is pending and pay later). If an org doesn't want to include a link for online payment, they can simply leave default_invoice_page empty (Edit: They cannot currently do this for newer installs, will have to make it possible). I think it would be very rare for an org to want to have a default_invoice_page for payments from the User Dashboard, but not to include a link for online payments in invoices (and in that case, they can edit the template).
Will do this and add docs if supported.https://lab.civicrm.org/dev/core/-/issues/4362civiimport failures with `cv`2023-11-08T00:50:25Zaydunsaidan.saunders@squiffle.ukciviimport failures with `cv`Overview
----------------------------------------
The `civiimport` extension causes log "API Request Authorization failed" messages when using `cv`
Reproduction steps
----------------------------------------
1. On a system where the `ci...Overview
----------------------------------------
The `civiimport` extension causes log "API Request Authorization failed" messages when using `cv`
Reproduction steps
----------------------------------------
1. On a system where the `civiimport` extension is not enabled: run `cv en civiimport`
Also, when installed run `cv flush`
Current behaviour
----------------------------------------
In the log file, note the backtrace:
```
Jun 15 11:26:51 [debug] $API Request Authorization failed = #0 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(153): CRM_Core_Error::backtrace("API Request Authorization failed", TRUE)
#1 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/AbstractAction.php(250): Civi\API\Kernel->runRequest(Object(Civi\Api4\Generic\DAOGetAction))
#2 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/ext/civiimport/Civi/Api4/Event/Subscriber/ImportSubscriber.php(221): Civi\Api4\Generic\AbstractAction->execute()
#3 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/ext/civiimport/Civi/Api4/Event/Subscriber/ImportSubscriber.php(197): Civi\Api4\Event\Subscriber\ImportSubscriber::getImportForms()
#4 [internal function](): Civi\Api4\Event\Subscriber\ImportSubscriber::on_civi_afform_get(Object(Civi\Core\Event\GenericHookEvent), "civi.afform.get", Object(Civi\Core\UnoptimizedEventDispatcher))
#5 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/Civi/Core/Event/ServiceListener.php(53): call_user_func_array((Array:2), (Array:3))
#6 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(251): Civi\Core\Event\ServiceListener->__invoke(Object(Civi\Core\Event\GenericHookEvent), "civi.afform.get", Object(Civi\Core\UnoptimizedEventDispatcher))
#7 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(73): Symfony\Component\EventDispatcher\EventDispatcher->callListeners((Array:2), "civi.afform.get", Object(Civi\Core\Event\GenericHookEvent))
#8 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/Civi/Core/CiviEventDispatcher.php(260): Symfony\Component\EventDispatcher\EventDispatcher->dispatch(Object(Civi\Core\Event\GenericHookEvent), "civi.afform.get")
#9 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/ext/afform/core/Civi/Api4/Action/Afform/Get.php(40): Civi\Core\CiviEventDispatcher->dispatch("civi.afform.get", Object(Civi\Core\Event\GenericHookEvent))
#10 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/BasicGetAction.php(52): Civi\Api4\Action\Afform\Get->getRecords()
#11 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/Civi/Api4/Provider/ActionObjectProvider.php(72): Civi\Api4\Generic\BasicGetAction->_run(Object(Civi\Api4\Generic\Result))
#12 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(158): Civi\Api4\Provider\ActionObjectProvider->invoke(Object(Civi\Api4\Action\Afform\Get))
#13 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/AbstractAction.php(250): Civi\API\Kernel->runRequest(Object(Civi\Api4\Action\Afform\Get))
#14 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/ext/afform/core/afform.php(399): Civi\Api4\Generic\AbstractAction->execute()
#15 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/Hook.php(272): afform_civicrm_alterMenu((Array:498))
#16 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/Hook/WordPress.php(136): CRM_Utils_Hook->runHooks((Array:33), "civicrm_alterMenu", 1, (Array:498), NULL, NULL, NULL, NULL, NULL)
#17 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/Civi/Core/CiviEventDispatcher.php(307): CRM_Utils_Hook_WordPress->invokeViaUF(1, (Array:498), NULL, NULL, NULL, NULL, NULL, "civicrm_alterMenu")
#18 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(251): Civi\Core\CiviEventDispatcher::delegateToUF(Object(Civi\Core\Event\GenericHookEvent), "hook_civicrm_alterMenu", Object(Civi\Core\UnoptimizedEventDispatcher))
#19 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(73): Symfony\Component\EventDispatcher\EventDispatcher->callListeners((Array:1), "hook_civicrm_alterMenu", Object(Civi\Core\Event\GenericHookEvent))
#20 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/Civi/Core/CiviEventDispatcher.php(260): Symfony\Component\EventDispatcher\EventDispatcher->dispatch(Object(Civi\Core\Event\GenericHookEvent), "hook_civicrm_alterMenu")
#21 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/Hook.php(168): Civi\Core\CiviEventDispatcher->dispatch("hook_civicrm_alterMenu", Object(Civi\Core\Event\GenericHookEvent))
#22 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/Hook.php(661): CRM_Utils_Hook->invoke((Array:1), (Array:498), NULL, NULL, NULL, NULL, NULL, "civicrm_alterMenu")
#23 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Menu.php(78): CRM_Utils_Hook::alterMenu((Array:498))
#24 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Menu.php(180): CRM_Core_Menu::xmlItems(TRUE)
#25 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Menu.php(294): CRM_Core_Menu::items(TRUE)
#26 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(389): CRM_Core_Menu::store()
#27 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/CRM/Extension/Manager.php(319): CRM_Core_Invoke::rebuildMenuAndCaches(TRUE)
#28 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/api/v3/Extension.php(42): CRM_Extension_Manager->install((Array:4))
#29 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_extension_install((Array:3))
#30 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(158): Civi\API\Provider\MagicFunctionProvider->invoke((Array:8))
#31 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(81): Civi\API\Kernel->runRequest((Array:8))
#32 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/api/api.php(22): Civi\API\Kernel->runSafe("Extension", "install", (Array:3))
#33 phar:///home/XXX/private/bin/cv/src/Command/BaseCommand.php(39): civicrm_api("Extension", "install", (Array:3))
#34 phar:///home/XXX/private/bin/cv/src/Command/ExtensionEnableCommand.php(68): Civi\Cv\Command\BaseCommand->callApiSuccess(Object(Cvphar\Symfony\Component\Console\Input\ArgvInput), Object(Cvphar\Symfony\Component\Console\Output\ConsoleOutput), "Extension", "install", (Array:3))
#35 phar:///home/XXX/private/bin/cv/vendor/symfony/console/Command/Command.php(127): Civi\Cv\Command\ExtensionEnableCommand->execute(Object(Cvphar\Symfony\Component\Console\Input\ArgvInput), Object(Cvphar\Symfony\Component\Console\Output\ConsoleOutput))
#36 phar:///home/XXX/private/bin/cv/vendor/symfony/console/Application.php(637): Cvphar\Symfony\Component\Console\Command\Command->run(Object(Cvphar\Symfony\Component\Console\Input\ArgvInput), Object(Cvphar\Symfony\Component\Console\Output\ConsoleOutput))
#37 phar:///home/XXX/private/bin/cv/vendor/symfony/console/Application.php(190): Cvphar\Symfony\Component\Console\Application->doRunCommand(Object(Civi\Cv\Command\ExtensionEnableCommand), Object(Cvphar\Symfony\Component\Console\Input\ArgvInput), Object(Cvphar\Symfony\Component\Console\Output\ConsoleOutput))
#38 phar:///home/XXX/private/bin/cv/src/Application.php(66): Cvphar\Symfony\Component\Console\Application->doRun(Object(Cvphar\Symfony\Component\Console\Input\ArgvInput), Object(Cvphar\Symfony\Component\Console\Output\ConsoleOutput))
#39 phar:///home/XXX/private/bin/cv/vendor/symfony/console/Application.php(101): Civi\Cv\Application->doRun(Object(Cvphar\Symfony\Component\Console\Input\ArgvInput), Object(Cvphar\Symfony\Component\Console\Output\ConsoleOutput))
#40 phar:///home/XXX/private/bin/cv/src/Application.php(32): Cvphar\Symfony\Component\Console\Application->run()
#41 phar:///home/XXX/private/bin/cv/bin/cv(28): Civi\Cv\Application::main("phar:///home/XXX/private/bin/cv/bin")
#42 /home/XXX/private/bin/cv(14): require("phar:///home/XXX/private/bin/cv/bin/cv")
#43 {main}
```
For `cv flush`:
```
Jun 15 11:35:11 [debug] $API Request Authorization failed = #0 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(153): CRM_Core_Error::backtrace("API Request Authorization failed", TRUE)
#1 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/AbstractAction.php(250): Civi\API\Kernel->runRequest(Object(Civi\Api4\Generic\DAOGetAction))
#2 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/ext/civiimport/Civi/Api4/Event/Subscriber/ImportSubscriber.php(221): Civi\Api4\Generic\AbstractAction->execute()
#3 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/ext/civiimport/Civi/Api4/Event/Subscriber/ImportSubscriber.php(197): Civi\Api4\Event\Subscriber\ImportSubscriber::getImportForms()
#4 [internal function](): Civi\Api4\Event\Subscriber\ImportSubscriber::on_civi_afform_get(Object(Civi\Core\Event\GenericHookEvent), "civi.afform.get", Object(Civi\Core\UnoptimizedEventDispatcher))
#5 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/Civi/Core/Event/ServiceListener.php(53): call_user_func_array((Array:2), (Array:3))
#6 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(251): Civi\Core\Event\ServiceListener->__invoke(Object(Civi\Core\Event\GenericHookEvent), "civi.afform.get", Object(Civi\Core\UnoptimizedEventDispatcher))
#7 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(73): Symfony\Component\EventDispatcher\EventDispatcher->callListeners((Array:2), "civi.afform.get", Object(Civi\Core\Event\GenericHookEvent))
#8 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/Civi/Core/CiviEventDispatcher.php(260): Symfony\Component\EventDispatcher\EventDispatcher->dispatch(Object(Civi\Core\Event\GenericHookEvent), "civi.afform.get")
#9 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/ext/afform/core/Civi/Api4/Action/Afform/Get.php(40): Civi\Core\CiviEventDispatcher->dispatch("civi.afform.get", Object(Civi\Core\Event\GenericHookEvent))
#10 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/BasicGetAction.php(52): Civi\Api4\Action\Afform\Get->getRecords()
#11 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/Civi/Api4/Provider/ActionObjectProvider.php(72): Civi\Api4\Generic\BasicGetAction->_run(Object(Civi\Api4\Generic\Result))
#12 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(158): Civi\Api4\Provider\ActionObjectProvider->invoke(Object(Civi\Api4\Action\Afform\Get))
#13 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/Civi/Api4/Generic/AbstractAction.php(250): Civi\API\Kernel->runRequest(Object(Civi\Api4\Action\Afform\Get))
#14 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/ext/afform/core/afform.php(399): Civi\Api4\Generic\AbstractAction->execute()
#15 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/Hook.php(272): afform_civicrm_alterMenu((Array:498))
#16 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/Hook/WordPress.php(136): CRM_Utils_Hook->runHooks((Array:33), "civicrm_alterMenu", 1, (Array:498), NULL, NULL, NULL, NULL, NULL)
#17 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/Civi/Core/CiviEventDispatcher.php(307): CRM_Utils_Hook_WordPress->invokeViaUF(1, (Array:498), NULL, NULL, NULL, NULL, NULL, "civicrm_alterMenu")
#18 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(251): Civi\Core\CiviEventDispatcher::delegateToUF(Object(Civi\Core\Event\GenericHookEvent), "hook_civicrm_alterMenu", Object(Civi\Core\UnoptimizedEventDispatcher))
#19 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(73): Symfony\Component\EventDispatcher\EventDispatcher->callListeners((Array:1), "hook_civicrm_alterMenu", Object(Civi\Core\Event\GenericHookEvent))
#20 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/Civi/Core/CiviEventDispatcher.php(260): Symfony\Component\EventDispatcher\EventDispatcher->dispatch(Object(Civi\Core\Event\GenericHookEvent), "hook_civicrm_alterMenu")
#21 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/Hook.php(168): Civi\Core\CiviEventDispatcher->dispatch("hook_civicrm_alterMenu", Object(Civi\Core\Event\GenericHookEvent))
#22 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/CRM/Utils/Hook.php(661): CRM_Utils_Hook->invoke((Array:1), (Array:498), NULL, NULL, NULL, NULL, NULL, "civicrm_alterMenu")
#23 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Menu.php(78): CRM_Utils_Hook::alterMenu((Array:498))
#24 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Menu.php(180): CRM_Core_Menu::xmlItems(TRUE)
#25 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Menu.php(294): CRM_Core_Menu::items(TRUE)
#26 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(389): CRM_Core_Menu::store()
#27 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/api/v3/System.php(33): CRM_Core_Invoke::rebuildMenuAndCaches(FALSE, FALSE)
#28 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_system_flush((Array:2))
#29 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(158): Civi\API\Provider\MagicFunctionProvider->invoke((Array:8))
#30 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(81): Civi\API\Kernel->runRequest((Array:8))
#31 /home/XXX/www/www/wp-content/plugins/civicrm/civicrm/api/api.php(22): Civi\API\Kernel->runSafe("System", "flush", (Array:2))
#32 phar:///home/XXX/private/bin/cv/src/Command/BaseCommand.php(39): civicrm_api("System", "flush", (Array:2))
#33 phar:///home/XXX/private/bin/cv/src/Command/FlushCommand.php(28): Civi\Cv\Command\BaseCommand->callApiSuccess(Object(Cvphar\Symfony\Component\Console\Input\ArgvInput), Object(Cvphar\Symfony\Component\Console\Output\ConsoleOutput), "System", "flush", (Array:2))
#34 phar:///home/XXX/private/bin/cv/vendor/symfony/console/Command/Command.php(127): Civi\Cv\Command\FlushCommand->execute(Object(Cvphar\Symfony\Component\Console\Input\ArgvInput), Object(Cvphar\Symfony\Component\Console\Output\ConsoleOutput))
#35 phar:///home/XXX/private/bin/cv/vendor/symfony/console/Application.php(637): Cvphar\Symfony\Component\Console\Command\Command->run(Object(Cvphar\Symfony\Component\Console\Input\ArgvInput), Object(Cvphar\Symfony\Component\Console\Output\ConsoleOutput))
#36 phar:///home/XXX/private/bin/cv/vendor/symfony/console/Application.php(190): Cvphar\Symfony\Component\Console\Application->doRunCommand(Object(Civi\Cv\Command\FlushCommand), Object(Cvphar\Symfony\Component\Console\Input\ArgvInput), Object(Cvphar\Symfony\Component\Console\Output\ConsoleOutput))
#37 phar:///home/XXX/private/bin/cv/src/Application.php(66): Cvphar\Symfony\Component\Console\Application->doRun(Object(Cvphar\Symfony\Component\Console\Input\ArgvInput), Object(Cvphar\Symfony\Component\Console\Output\ConsoleOutput))
#38 phar:///home/XXX/private/bin/cv/vendor/symfony/console/Application.php(101): Civi\Cv\Application->doRun(Object(Cvphar\Symfony\Component\Console\Input\ArgvInput), Object(Cvphar\Symfony\Component\Console\Output\ConsoleOutput))
#39 phar:///home/XXX/private/bin/cv/src/Application.php(32): Cvphar\Symfony\Component\Console\Application->run()
#40 phar:///home/XXX/private/bin/cv/bin/cv(28): Civi\Cv\Application::main("phar:///home/XXX/private/bin/cv/bin")
#41 /home/XXX/private/bin/cv(14): require("phar:///home/XXX/private/bin/cv/bin/cv")
#42 {main}
```
Both get to `/home/XXX/www/www/wp-content/plugins/civicrm/civicrm/ext/civiimport/Civi/Api4/Event/Subscriber/ImportSubscriber.php(197): Civi\Api4\Event\Subscriber\ImportSubscriber::getImportForms()`
Expected behaviour
----------------------------------------
No errors.
Note that if you run `cv ext import -U admin` or `cv flush -U admin`, these run without errors but are not the normal invocations. I'm not clear if this should be fixed in `cv` or `civiimport`.
`cv` mostly lets you do 'adminy things' without specifying a user. Some actions (like `cv scr`, `cv ev`) need a user but `cv flush` and `cv en`, `cv dis` have not needed this.
Environment information
----------------------------------------
* __CiviCRM:__ 5.62.0 <!-- Not new - issue exists earlier as well. -->
* __PHP:__ 7.4.32
* __cv:__ v0.3.42
Comments
----------------------------------------
ping @tottenhttps://lab.civicrm.org/dev/core/-/issues/4364Afform: Adding forms to menu is not compatible with Customize Navigation Menu2023-10-19T23:44:23ZlarsssandergreenAfform: Adding forms to menu is not compatible with Customize Navigation MenuIf you add a menu item for a form directly in the form, it shows up sort of where you want it (though the interface to set the order is pretty unhelpful, because you basically are guessing what the weight of existing items in the menu mi...If you add a menu item for a form directly in the form, it shows up sort of where you want it (though the interface to set the order is pretty unhelpful, because you basically are guessing what the weight of existing items in the menu might be). However, if you later go to Customize Navigation Menu, you can move the menu item you created around and it looks like it works and it will work for a while, but then later, it will move back to the location and weight set in the form.
This is confusing for users and frustrating if you don't know what's going on. Seems like we need to have just one way to edit the menu. Maybe it makes sense to simply remove the add to menu option from forms and let users add the menu item manually? Or alternately, we need a way for the menu location and weight to only be used on inserting the menu item and to be uneditable in the form afterwards, maybe with a help text that tells you to edit this directly in the menu.https://lab.civicrm.org/dev/core/-/issues/4366Vcards - tokens & other rendering2023-06-20T13:19:14ZeileenVcards - tokens & other renderingIt turns out we render html vcards for event locations in our emails - eg.
<div class="location vcard"><span class="adr"><span class="street-address">8 Baker Street</span><br />
<span class="extended-address">Upstairs</span><br />
<span...It turns out we render html vcards for event locations in our emails - eg.
<div class="location vcard"><span class="adr"><span class="street-address">8 Baker Street</span><br />
<span class="extended-address">Upstairs</span><br />
<span class="locality">London</span>,<br />
</span></div>
I'm not sure if this is
a) good - it's super helpful or
b) bad - it's copy & paste from our front end pages & lands us in the spam folder
I am hoping people will weigh in on the question of whether vcard html in email is desirable or not because making code do something silly more effectively is about 78 on my list of priorities.
If the former then I think we want to do it in a more standardised way than the dragon-code that currently does it.
I found a library https://github.com/jeroendesloovere/vcard
@colemanw also suggested an api calculated field (similar to contribution.paid_amount) although it could be tricky - see https://github.com/civicrm/civicrm-core/pull/26296#issuecomment-1561001040
We would want it to be an option for the token - ie regardless of whether there is a use case for the vcard in emails there is a use case for use to format addresses with line breaks.https://lab.civicrm.org/dev/core/-/issues/4367Apiv4 Order api2023-12-02T04:28:01ZeileenApiv4 Order api
There is general agreement that the biggest issue with the v3 api is the confusing arrays it requires. My preference in fact is for a fairly non-standard Order api - ie
```
Order::create()
->setContributionParameters([
'conta...
There is general agreement that the biggest issue with the v3 api is the confusing arrays it requires. My preference in fact is for a fairly non-standard Order api - ie
```
Order::create()
->setContributionParameters([
'contact_id' => 56,
'financial_type_id:name' => 'Donation',
])
->addLineItem([
'price_field_value_id:name' => 'student_rate',
'entity_id.role_id:name' => 'Attended',
'entity_id.contact_id' => 87,
'entity_id.event_id' => 6,
'entity_table' => 'civicrm_participant',
])
->execute();
```
On update we would have actions like `addLineItem`, `removeLineItem`
Obviously this starts to highlight a whole lot of issues
**1) at the contribution params level**
there are some parameters that we have long-standing discussions around - financial_type_id, receive_date, payment_instrument_id. I think we should probably not start with talking about those as we might never get any further
**2) line items**
- one specific thing I think we all agree on is that we don't want line items to have to belong to the same price set. There will be some fighting with the code to get there but it's probably an issue that lives outside the bike shed
- in the example above the entity_table is passed in. For memberships that can be inferred from the price_field_value_id, but for event participants there is nothing on the price field or price_field_value that declares something as being event related
- for line items we kinda want to require the minimum required info which varies a bit.... ie
**-- if we have only the line_total (in the line item or just the contribution.total_amount) we can assume**
- the price field id is the default contribution price field
- the quantity is 1
- the unit_price is the line_total
**-- if we have only the qty and the unit_price we can assume**
- the price field id is the default contribution price field
- the line_total is unit_price * qty
**-- if we have only the line_total and the entity_table, which is civicrm_membership we can assume**
- the price field id is the default membership field
**but we require one of membership_type_id or price_field_value_id, from which we can determine amounts **
**-- if we have only the price_field_value id we can assume**
- the amount & price field can be looked up from it. We can assume qty to be 1 unless provided
- We need some way of specifying relevant entity values. (I suspect this is where the rubber hits the brake pads in the bikeshedding process). In the above example I have leveraged `entity_id` in the way we do for other apiv4 related entities. The v3 order api had some ideas about entity parameters which didn't align with our specification that closely - I think they were effectively 'sub-participants' and if we want to add that it might be `'entity_id.registered_participants' => []` perhaps. It's also rather tempting to refer to use `participant_id` to stand in for `entity_id` when it reflects the line....
**3) the add payment.**
We currently chain this - I did include above in the first iteration of this but removed based on the discussion. The world won't end if we don't do that.https://lab.civicrm.org/dev/core/-/issues/4368Changing repeating events crashes when there are events to be deleted/removed...2023-06-20T13:29:25ZRichChanging repeating events crashes when there are events to be deleted/removed from seriesI _think_ I've pinned this one down.
When you change the end-date for repeating events, it makes a list of the original repeats and will either delete them (if no participants) or remove them from the series.
The code here just plain l...I _think_ I've pinned this one down.
When you change the end-date for repeating events, it makes a list of the original repeats and will either delete them (if no participants) or remove them from the series.
The code here just plain looks wrong to me:
https://lab.civicrm.org/dev/core/-/blob/1edfed415fe687e7c7847df41497352b5fa96368/CRM/Core/Form/RecurringEntity.php#L408
It's doing a call like `call_user_func([$classname, $argument1])` which should surely be `call_user_func([$classname, $methodname], $argument1)`
In the execution, the helper class (`$classname` above) is `CRM_Event_DAO_Event", I have no idea what method should be called, and the `$argument1` is an array of IDs.
Commenting out that line seems to be ok, but I've no idea what it was supposed to do. This problem has been here for at least 8 years(!).https://lab.civicrm.org/dev/core/-/issues/4370Group opt in and subscribe/unsubscribe in form builder2023-09-01T19:44:08ZMichael McAndrewGroup opt in and subscribe/unsubscribe in form builder# Group subscribe and unsubscribe in form builder
This issue is an attempt to add functionality to handle group subscribe and unsubscribe in form builder as per the roadmap https://lab.civicrm.org/dev/core/-/issues/3761.
## Scenarios
...# Group subscribe and unsubscribe in form builder
This issue is an attempt to add functionality to handle group subscribe and unsubscribe in form builder as per the roadmap https://lab.civicrm.org/dev/core/-/issues/3761.
## Scenarios
Here are a few scenarios that we'd like to cater for...
### Opt in only flow
This flow is useful to give people the option to opt in to a group as part of another flow, e.g. when I register for an event, I might want to opt into an events newsletter. Note: I don't typically want to opt *out* of such a newsletter in these situations, and an opt out is likey unexpected and undesirable.
Opt in flows are also useful to create newsletter sign ups that contain multiple groups/mailing lists that people can sign up for.
We render a checkbox and group name. When the checkbox is ticked, we add a contact to the group (this might be a no-op if they are already in the group). If the checkbox is not ticked, we do nothing (i.e. we do not unsubscribe anyone that is already subscribed to the group).
We render a separate component for each group that the contact wants to opt into (rather than a single component that contains all groups).
By default checkboxes are not ticked when the form is loaded. This aligns nicely for workflows (e.g. GDPR compliant workflows) where opting in should be a conscious decision. However, it should be possible to set the checkbox to be ticked by default if desired. This may be appropriate in certain situations, e.g. it would be reasonable to pre-check a 'Please send me members newsletter' checkbox in a membership form if you wanted most people to receive the members newsletter but also wanted to give the option to opt out.
## Subscribe and unsubscribe flow
This allows people to both add themselves and remove themselves from groups.
This is typically used in 'Manage my notifications/communication preferences' screens and similar. It allows people to see what groups they are currently subscribed to, and subscribe and unsubscribe from them as appropriate.
We render a separate UI element for each group that the contact wants to opt into. When the checkbox is ticked, we add a contact to the group (if they are not already in it). If the checkbox is not ticked, we remove them from the group (if they are already in it).
## Automatic subscribe / unsubscribe flow
Sometimes we might want to automatically sign someone up to a mailing list without presenting a checkbox to tick. For example...
![image](/uploads/e5774b8f0d319fa33cee79f471d7049b/image.png)
One solution in this situation would be to add a hidden and checked subscribe or opt in element. In the situation that submitting the form should unsubscribe you, adding an unchecked subscribe/unsubscribe component should do the trick.
## The data model and form processing
I'm not 100% sure what the mark up for this should look like. An email join looks like this:
```html
<fieldset af-fieldset="Individual1" class="af-container" af-title="Individual 1">
<afblock-name-individual></afblock-name-individual>
<div af-join="Email">
<af-field name="email" />
</div>
</fieldset>
```
But group subscriptions and un-subscriptions don't work quite the same way.
In terms of the API, I think that what we want to do can probably be achieved with something like the save api:
```php
$results = \Civi\Api4\GroupContact::save()
->addRecord([
'group_id' => 2,
'contact_id' => 203,
'status' => 'Added',
])
->setMatch([
'group_id',
'contact_id',
])
->execute();
```
But I think there are a few tweaks that we'd want to do, e.g. we ideally do not want to record a status=removed when submitting a form with an unsubscribe/subscribe if they were not in the group in the first place.
And I am not sure how the save api gets called in formbuilder.
In terms of what the html might look like, I am wondering if it makes sense to create some components that encapsulate some of the logic, so that it ends up looking like this.
```html
<fieldset af-fieldset="Individual1" class="af-container" af-title="Individual 1">
<afblock-name-individual></afblock-name-individual>
<af-group group_id="2" />
</fieldset>
```
It might make sense to add a mode property that could be set to control the display and behaviour, e.g. `<af-group group_id="2" mode='opt-in'/>`
- normal - opts in and out
- opt-in - only allows opting in
- auto-add - hidden and adds people on submission
- auto-remove - hidden and removes people on submission
And a default property for opt in workflows, e.g. <af-group group_id="2" mode='opt-in' default=true/>
The above component would be responsible for generating the checkbox and text and for generating appropriate values when the form is submitted.
I can't see a way of doing it with the existing components. I might be missing something conceptual but here is my attempt. It made me think that a new component would probably make things easier.
```html
<fieldset af-fieldset="Individual1" class="af-container" af-title="Individual 1">
<afblock-name-individual></afblock-name-individual>
<div af-join="GroupContact">
<af-field name="group_id" /> <?-- do we also need to join on group to get the name? -->
<af-field name="status" /> <?-- Would need to translate a checkbox to value?'Added':'Removed'? -->
</div>
</fieldset>
```
## Email confirmation
At the moment, double opt in is closely linked to subscribing to an email group. IIRC in the past we have used something like
```php
<?php
civicrm_api3('MailingEventSubscribe', 'create', ...);
```
But this has a few drawbacks, including having to confirm multiple email subscriptions for a single form. Since we are also working on https://lab.civicrm.org/dev/core/-/issues/4232, we think it probably makes sense to leverage that for any logged out forms which will require that an email needs to be confirmed before any form processing occurs.https://lab.civicrm.org/dev/core/-/issues/4371AdminUI: Find contact should follow the setting "Search Primary Details Only"2023-06-20T13:19:52ZsamuelsovAdminUI: Find contact should follow the setting "Search Primary Details Only"The new "Find Contacts" shipped with Admin UI search only for Primary Email but we should take he setting "Search Primary Details Only" into account the way it is without AdminUI :
![ksnip_20230616-141644](/uploads/9441fba97690e6df4bc88...The new "Find Contacts" shipped with Admin UI search only for Primary Email but we should take he setting "Search Primary Details Only" into account the way it is without AdminUI :
![ksnip_20230616-141644](/uploads/9441fba97690e6df4bc883613ac9eb27/ksnip_20230616-141644.png)samuelsovsamuelsovhttps://lab.civicrm.org/dev/core/-/issues/4378Schema support for rounding2023-08-30T04:05:32ZeileenSchema support for roundingWe have an ongoing issue with rounding which I essentially believe is because our schema does not adequately support the variations on rounding in use, and I think we need to add additional fields to support this. The principle I think w...We have an ongoing issue with rounding which I essentially believe is because our schema does not adequately support the variations on rounding in use, and I think we need to add additional fields to support this. The principle I think we need to work to is:
**Can we calculate the 'missing' values with the data we have, if not we need to store it not treat it as calculable**
Our exising code assumes that if you have 2 out of 3 of tax_amount, tax_rate and one of tax_inclusive or tax_exclusive you can calculate the third. However, if what you have stored is numbers with some rounding applied you actually can't reverse engineer them.
**Specific proposal**
I propose we add to the schema
- civicrm_contribution.total_amount_exclusive
- civicrm_line_item.line_total_inclusive
- civicrm_line_item.tax_rate (note this CAN be calculated from the price field value id but could change over time either because of legislative changes such as sales tax increases - it only ever increases - or configuration changes.)
- civicrm_price_field_value.amount_inclusive
These would be calculated, if not provided, at the point of save. v4 Order api and Form Builder & BAO layer would support more nuanced usage of these but I don't anticipate any immediate changes to existing contribution or configuration quick forms to accommodate these. Search kit would expose them.
There is a bit of a gotcha around not-exposing them & being able to edit them on forms - so it is likely the contribution edit form would need to be adjusted to avoid re-saving in a way that causes problems. Possibly we need to get the ability to edit amount off the main form & into a sub-form which incorporates line item editor - this is something we have talked about before.
**Current situation**
The variations of rounding approaches we have people reporting using are
1) start with tax inclusive
2) start with tax exclusive
e.g
|Version| Tax exclusive | tax rate | tax amount | tax inclusive|
|----|----|----|----|----|
|start from inclusive| 869.57 | 15% | 130.43 | 1000|
|start from exclusive| 869.57 | 15% | 130.44 | 1000.01|
3) Round each line item before totalling (I think we are doing this) - apply tax as a % of the rounded amount, round the tax on each line
3) Store each line item un-rounded - apply tax per line item & add up
4) Total and then round the sum of the line items - apply tax to the total as a %, the amount that does not fit the line items is a rounding line item ?
The relevant existing tables /fields are
civicrm_contribution
- total_amount (inclusive)
- tax_amount
~~ - non_deductible_amount~~
civicrm_line_item
- line_total (exclusive)
- tax_amount
~~ - non_deductible_amount~~
civicrm_price_field_value
- amount (exclusive)
~~ - non_deductible_amount~~
civicrm_financial_account
- tax_rate
**Related issues**
https://lab.civicrm.org/dev/core/-/issues/3714
https://lab.civicrm.org/dev/financial/-/issues/189
https://lab.civicrm.org/dev/financial/-/issues/52
**Other**
Api v4 contribution.get supports returning `tax_exclusive_amount` for the field proposed as total_amount_exclusive abovehttps://lab.civicrm.org/dev/core/-/issues/4379Preview support for event online template2023-06-20T13:20:13ZeileenPreview support for event online templateWe have preview support for the event offline template - but it doesn't cover additional participants - focussing for now on the line items I'm documenting what to expect
1) We will assign the same variables as other financial templates...We have preview support for the event offline template - but it doesn't cover additional participants - focussing for now on the line items I'm documenting what to expect
1) We will assign the same variables as other financial templates (taxRateBreakdown, lineItems)
2) I think we should also assign a participant specific version of the above & then toggle whether to show all or not based on whether the participant is primary.
I'm gonna add screen shots to what happens now during an online flow because I know there are existing inconsistencies and that is considered correct
Also refer https://github.com/civicrm/civicrm-core/pull/23098 for thoughts about 'right behaviour' and
https://lab.civicrm.org/dev/core/-/issues/224https://lab.civicrm.org/dev/core/-/issues/4380js error on demo site2023-06-20T13:17:10Zeileenjs error on demo sitejs error on demo site
https://dmaster.demo.civicrm.org/civicrm/event/manage/fee?reset=1&action=update&id=1&selectedChild=registration#/volunteer/manage/0
![image](/uploads/d878eff48bc6312add6a8b929166a60c/image.png)
@colemanw I know y...js error on demo site
https://dmaster.demo.civicrm.org/civicrm/event/manage/fee?reset=1&action=update&id=1&selectedChild=registration#/volunteer/manage/0
![image](/uploads/d878eff48bc6312add6a8b929166a60c/image.png)
@colemanw I know you have suggested civi-volunteer remove the angular profiles & they have said 'can you give us some pointers' - this is a bit problematic as it is on our demo sitehttps://lab.civicrm.org/dev/core/-/issues/4381CiviReport: default orientation for pdf output2023-06-22T08:23:40ZJanecCiviReport: default orientation for pdf outputOverview
----------------------------------------
I was unable to set the orientation for pdf output of reports.
Example use-case
----------------------------------------
1. Configure a PDF output format in settings
1. Use the "print PD...Overview
----------------------------------------
I was unable to set the orientation for pdf output of reports.
Example use-case
----------------------------------------
1. Configure a PDF output format in settings
1. Use the "print PDF letter"-action
Current behaviour
----------------------------------------
You PDF-report will be in landscape
Proposed behaviour
----------------------------------------
Use the configured setting.
Comments
----------------------------------------
Removing the hard coded value solves thishttps://lab.civicrm.org/dev/core/-/issues/4385version=4 is not passed to Mailing.create on APIv4 so MailingJob gets scheduled2023-09-13T01:30:02ZSandor Semseyversion=4 is not passed to Mailing.create on APIv4 so MailingJob gets scheduledOverview
----------------------------------------
I'd like to create a single Mailing entity through APIv4 without scheduling a MailingJob and calculating recipients.
Reproduction steps
----------------------------------------
1. Call M...Overview
----------------------------------------
I'd like to create a single Mailing entity through APIv4 without scheduling a MailingJob and calculating recipients.
Reproduction steps
----------------------------------------
1. Call Mailing.create through API Explorer or `cv`
1. Notice that a MailingJob is created
Current behaviour
----------------------------------------
According to https://github.com/civicrm/civicrm-core/blob/94b9b95547d3f8292740c059f77f83cc45e57b57/CRM/Mailing/BAO/Mailing.php#L1622-L1629 this shouldn't happen by default, but it does: `$params['version']` is empty and `self::doSubmitActions()` is called.
Expected behaviour
----------------------------------------
`$params['version']` is populated so `CRM_Mailing_BAO_Mailing::doSubmitActions()` doesn't fire.
Comments
----------------------------------------
This is similar to https://github.com/civicrm/civicrm-core/blob/94b9b95547d3f8292740c059f77f83cc45e57b57/CRM/Member/BAO/Membership.php#L334-L343. In that case `Civi\Api4\Service\Spec\Provider\MembershipCreationSpecProvider` injects `version` parameter into the API call, but for Mailing such spec provider doesn't exists.
I can do some work with this, I'm just not sure if that spec provider is missing by design or not...
Also I can pass in `version=4` explicitly or use `_skip_evil_bao_auto_schedule_` and `_skip_evil_bao_auto_recipients_` to prevent submit actions to happen.https://lab.civicrm.org/dev/core/-/issues/4386Contact tags don't work when triggered using the CiviRules action on Contact ...2023-06-20T13:49:44Zhitesh_compucorpContact tags don't work when triggered using the CiviRules action on Contact formOverview
----------------------------------------
When using the CiviRules extension there is an issue where adding tags to a contact does not work as expected while adding new contact using contact form. The problem arises when a rule ...Overview
----------------------------------------
When using the CiviRules extension there is an issue where adding tags to a contact does not work as expected while adding new contact using contact form. The problem arises when a rule is triggered for `Add Tag to Contact` action, causing it to remove any tags added by CiviRules before saving the contact form.
Reproduction steps
----------------------------------------
1. Create new CiviRules having Trigger as `Contact of any type is added` and Action as `Add Tag to Contact`
1. Create new contact
1. Contact tags configured by Civirules gets removed once the form is saved.
![issue_civirules](/uploads/8dcb8cc83041c41d1a2b7c48ac2df4b2/issue_civirules.gif)
Current behaviour
----------------------------------------
Tags configured from Civirules gets removed while saving contact form.
Expected behaviour
----------------------------------------
Civirules Tags shouldn't get deleted once we add new contact using contact form.
Environment information
----------------------------------------
* __CiviCRM:__ Master
* __CMS:__ Drupal 7.30
PR - https://github.com/civicrm/civicrm-core/pull/26580https://lab.civicrm.org/dev/core/-/issues/4388Order of constructor params for QuickForms2023-07-11T16:25:57Zluke.stewartOrder of constructor params for QuickFormsThere is a bit of chaos in param order here as encounted on related issue - is this something that we should be concerned about in this point of the lifecycle using Quickforms? Maybe if it's not broken we shouldn't fix?
Below list is a...There is a bit of chaos in param order here as encounted on related issue - is this something that we should be concerned about in this point of the lifecycle using Quickforms? Maybe if it's not broken we shouldn't fix?
Below list is a result of grep and then manual copy and paste and spacing to try and match up like orderings.
```
xbutton.php: function __construct($elementName = null, $elementContent = null, $attributes = null)
advmultiselect.php: function __construct($elementName = null, $elementLabel = null,
element.php: function __construct($elementName=null, $elementLabel=null, $attributes=null)
file.php: function __construct($elementName=null, $elementLabel=null, $attributes=null)
input.php: function __construct($elementName=null, $elementLabel=null, $attributes=null)
password.php: function __construct($elementName=null, $elementLabel=null, $attributes=null)
textarea.php: function __construct($elementName=null, $elementLabel=null, $attributes=null)
text.php: function __construct($elementName=null, $elementLabel=null, $attributes=null)
hiddenselect.php:function __construct($elementName=null, $elementLabel=null, $options=null, $attributes=null)
select.php: function __construct($elementName=null, $elementLabel=null, $options=null, $attributes=null)
autocomplete.php:function __construct($elementName=null, $elementLabel=null, $options=null, $attributes=null)
date.php: function __construct($elementName=null, $elementLabel=null, $options=array(), $attributes=null)
hierselect.php: function __construct($elementName=null, $elementLabel=null, $attributes=null, $separator=null)
static.php: function __construct($elementName=null, $elementLabel=null, $text=null)
checkbox.php: function __construct($elementName=null, $elementLabel=null, $text='', $attributes=null)
advcheckbox.php: function __construct($elementName=null, $elementLabel=null, $text=null, $attributes=null, $values=null)
radio.php: function __construct($elementName=null, $elementLabel=null, $text=null, $value=null, $attributes=null)
button.php: function __construct($elementName=null, $value=null, $attributes=null)
reset.php: function __construct($elementName=null, $value=null, $attributes=null)
submit.php: function __construct($elementName=null, $value=null, $attributes=null)
link.php: function __construct($elementName=null, $elementLabel=null, $href=null, $text=null, $attributes=null)
group.php: function __construct($elementName=null, $elementLabel=null, $elements=null, $separator=null, $appendName = true, $attributes = null)
image.php: function __construct($elementName=null, $src='', $attributes=null)
header.php: function __construct($elementName=null, $text = null)
hidden.php: function __construct($elementName=null, $value='', $attributes=null)
Page.php: function __construct($formName, $method = 'post', $target = '', $attributes = null)
Controller.php: function __construct($name, $modal = true)
html.php: function __construct($text = null)
```https://lab.civicrm.org/dev/core/-/issues/4389Can't import using contact id2023-08-03T12:40:09Zaydunsaidan.saunders@squiffle.ukCan't import using contact idOverview
----------------------------------------
`Contact id` cannot be selected as a field to match on when importing.
(I'm fairly certain this used to work, but don't know when it stopped.)
Reproduction steps
-----------------------...Overview
----------------------------------------
`Contact id` cannot be selected as a field to match on when importing.
(I'm fairly certain this used to work, but don't know when it stopped.)
Reproduction steps
----------------------------------------
1. Click on **Contacts -> Import Contacts**.
1. Upload a CSV with a 'contact id' column
1. Note that there is no option to select 'Contact ID' in the field mapping options.
Current behaviour
----------------------------------------
Can't match to existing contact using contact id.
Expected behaviour
----------------------------------------
Can match to existing contact using contact id.
Environment information
----------------------------------------
* __CiviCRM:__ master_ <!-- If this problem relates to an upgrade, then specify both old and new versions -->
Comments
----------------------------------------https://lab.civicrm.org/dev/core/-/issues/4395Token support to allow us to migrate sort_name, display_name, address formats...2023-06-28T07:10:08ZeileenToken support to allow us to migrate sort_name, display_name, address formats to tokensWe have a goal to get sort_name, display_name and address formats to resolve using the standard token system, at the same time as the greetings are resolved.
Unfortunately there are some things they support at the moment that our tokens...We have a goal to get sort_name, display_name and address formats to resolve using the standard token system, at the same time as the greetings are resolved.
Unfortunately there are some things they support at the moment that our tokens don't. Our tokens DO support the default filter
`{contact.first_name|default:"donor"}`
and they support the magic space - ie
`{contact.first_name}{ }{contact.last_name}`
which resolves a space in the above, but not if there is no last name.
However, in sort name there is a variant on the magic space we don't currently support in tokens - - ie
`{contact.last_name}{, }{contact.first_name}`
The regex that supports that actually removes the whole `{}` contents if the following tag is empty or renders the contents otherwise.
This is pretty hard to make compatible with smarty :-(, which is a requirement to standardise. So ideally we would
1) make the magic syntax support know usages (within reason) which so far are the magic space, the magic comma and this variant
`{contact.first_name}{ ~ }{contact.nick_name}{ ~ }{contact.last_name}`
2) add a system-check to highlight notify using variations of the magic syntax other than the 3 on our radar that they may not work in future upgrades if we don't add support & direct them to this ticket to comment & explain the use case
3) depending on the variations that come out of 2 add 'micro-conditional support'
Note micro-conditionals was an idea @totten came up with when we were spit-balling this - I've pasted his thoughts below
---------------------------------------------------------------------------------------------------------------------
micro-conditionals: special tokens that conditionally display a handful of symbols
```
---------
{contact.first_name} {contact.last_name} { ~ } {contact.nick_name}
{contact.last_name}{ }{contact.first_name}
{contact.last_name}{, }{contact.first_name}
{contact.first_name}{ (}{contact.nick_name}{) }{contact.last_name}
Dear {contact.first_name}{?friend},
----------
{contact.first_name contact.last_name " ~ " contact.nick_name}
{contact.last_name " " contact.first_name}
{contact.last_name ", " contact.first_name}
{contact.first_name " (" contact.nick_name ") " contact.last_name}
Dear {contact.first_name ?friend},
----------
{{{contact.first_name contact.last_name ~ contact.nick_name}}}
{{{contact.last_name contact.first_name}}}
{{{contact.last_name, contact.first_name}}}
{{{contact.first_name (contact.nick_name) contact.last_name}}}
Dear {{{contact.first_name??"friend"}}},
-------------
```
Also note - first draft of appropriate test https://github.com/civicrm/civicrm-core/pull/26637/files#diff-a5d237ba4e392d0e8ad764a535315f0b1101cc5ca61c39b4e572de42f5c6b4bchttps://lab.civicrm.org/dev/core/-/issues/4397What should the Name and Address reserved general Individual dedupe rule do?2023-06-30T00:14:21ZlarsssandergreenWhat should the Name and Address reserved general Individual dedupe rule do?We have a reserved dedupe rule on new installs for Individuals called Name and Address.
What it actually does is matches contacts who have the same first name, last name and street address. What it claims to do is the following:
![image]...We have a reserved dedupe rule on new installs for Individuals called Name and Address.
What it actually does is matches contacts who have the same first name, last name and street address. What it claims to do is the following:
![image](/uploads/d427acb2b1c3ce07c994b68a2371ac62/image.png)
[This rule](https://github.com/civicrm/civicrm-core/blob/master/sql/civicrm_data/civicrm_dedupe_rule/IndividualGeneral.sqldata.php) also includes suffix_id and middle_name with weights of 1, which cannot influence the matches (threshold 15, all other items have weight 5), so these don't do anything.
There is a [hard-coded query](https://github.com/civicrm/civicrm-core/blob/master/CRM/Dedupe/BAO/QueryBuilder/IndividualGeneral.php) for this rule that should match up with the above (right now we are querying middle_name, suffix and birthdate for no reason, which is kind of ironic since this query claims to be optimized).
None of this has changed in at least ten years.
Personally, I don't think matching on first, last and street address is useful (as street addresses are often written slightly differently so are not that likely to match). Maybe we should just eliminate this reserved dedupe rule, since I can't see that it is used for anything. If not, maybe we should make it more useful by making it just first and last name. Or maybe there is some reason this is useful as is and we should simply make this all consistent so it just matches on first, last and address and nothing more.https://lab.civicrm.org/dev/core/-/issues/4399Unable to merge incomplete memberships due to missing end_date2023-07-06T06:38:24Zfreeform.stephUnable to merge incomplete memberships due to missing end_dateWhen a contribution fails when purchasing a membership, a membership remains (as either pending or cancelled) that does not have an end date. When merging contacts any memberships are expected to have an end date.
`"UPDATE civicrm_membe...When a contribution fails when purchasing a membership, a membership remains (as either pending or cancelled) that does not have an end date. When merging contacts any memberships are expected to have an end date.
`"UPDATE civicrm_membership SET end_date = '' WHERE id=ID [nativecode=1292 ** Incorrect date value: '' for column `civicrm`.`civicrm_membership`.`end_date` at row 1]"`https://lab.civicrm.org/dev/core/-/issues/4400Export of contacts when filtering on custom field exports all contacts in dat...2023-07-06T06:37:41ZtjhellmannExport of contacts when filtering on custom field exports all contacts in databaseOverview
----------------------------------------
When I filter contacts from Advanced Search and select a custom field to filter on, in the next screen, the correct list and number of records comes up. From there if I select All [number...Overview
----------------------------------------
When I filter contacts from Advanced Search and select a custom field to filter on, in the next screen, the correct list and number of records comes up. From there if I select All [number of records] records and select Export contacts, the next screen also shows the correct number of contacts from the previous screen. But when I click 'continue' to export the records, the export contains all the records in the database. This does not happen when the list is filtered for non custom fields.
Reproduction steps
----------------------------------------
1. Visit Advanced Search
1. Select a custom field value as search criteria and click search
1. See expected search results. Now click All Records and Export Contacts.
2. On the next screen see that the expected number of contacts say they will be in the export. Click continue and all the contacts in the database are in the exported file.
Environment information
----------------------------------------
* __CiviCRM:__ 5.62.1
* __PHP:__ 8.0.29
* __CMS:__ Drupal 9.5.9
* __Database:__ MySQL 5.7.39https://lab.civicrm.org/dev/core/-/issues/4401SearchKit - Report replacement - as a standard user without edit searchkit pe...2023-07-06T06:37:04ZsamuelsovSearchKit - Report replacement - as a standard user without edit searchkit permission, add a way to show/hide columns in table displayThere is already an [extension](https://lab.civicrm.org/extensions/search_kit_reports) that recreate the queries of core reports into SearchKit so admin/super user can customize and use them instead of report.
However, as a standard use...There is already an [extension](https://lab.civicrm.org/extensions/search_kit_reports) that recreate the queries of core reports into SearchKit so admin/super user can customize and use them instead of report.
However, as a standard user, edit a Searchkit is too complicated and reports is still the better option if we need to provide a lot of flexibility to users.
Currently, in Reports, standard user have access to customize :
- Columns - no way to do this in SK without editing the SK - hence the proposal
- Sorting - already there by clicking on the columns of the SK table
- Filters - already there by configuring them with FormBuilder
- Title and Format - don't think it is required
- Email delivery - missing, already documented in https://lab.civicrm.org/dev/core/-/issues/3478
So I think the main undocumented missing feature if we want to replace the reports is to have a way for a standard user to choose which columns to show/hide in a table display. It needs to apply to the screen and to the Download action.
As an example, I like the way new reports in Quickbooks works with the ability to switch each column on/off and as a bonus allow to change columns order :
![Rapport](/uploads/550ef9e7d7ffd1f19849b4034faa7765/Rapport.png)
As a first step, I don't think we need to save the user preferences but we will probably want to be able to do that / reset to default eventually.https://lab.civicrm.org/dev/core/-/issues/4402Change unsupervised Household dedupe rule to email only2023-07-06T23:20:28ZlarsssandergreenChange unsupervised Household dedupe rule to email onlyAs @DaveD [pointed out](https://github.com/civicrm/civicrm-core/pull/26673#issuecomment-1613302861), the default unsupervised Household dedupe rule that matches on name or email doesn't make a lot of sense. Presumably, you could easily h...As @DaveD [pointed out](https://github.com/civicrm/civicrm-core/pull/26673#issuecomment-1613302861), the default unsupervised Household dedupe rule that matches on name or email doesn't make a lot of sense. Presumably, you could easily have multiple households with the name "Jones family" or similar in whatever format you choose for household names. You wouldn't want these to be merged automatically.
I think the easiest and clearest solution is only to merge households with the same email, but then that won't help those without emails. We could do something like threshold 20, email 20, name 10, street address 10, phone 10, but I'm not sure we gain much from that. We can keep name or email as the supervised rule.https://lab.civicrm.org/dev/core/-/issues/4403SK / API 4 Explorer: event_queue_id, job id, bounce id, etc autocompletes don...2023-07-05T04:30:05ZlarsssandergreenSK / API 4 Explorer: event_queue_id, job id, bounce id, etc autocompletes don't workEdited as this issue is more general than I thought. Fairly minor issue, but:
In SK or API 4 Explorer, for mailing event id fields (event queue id, job id, bounce id, etc), the autocomplete fields don't work. No matter what you input, i...Edited as this issue is more general than I thought. Fairly minor issue, but:
In SK or API 4 Explorer, for mailing event id fields (event queue id, job id, bounce id, etc), the autocomplete fields don't work. No matter what you input, it shows `Loading failed` and you can't make a selection.
To replicate: Choose MailingEventBounce or similar, Where event_queue_id and =.