CiviCRM Core issueshttps://lab.civicrm.org/dev/core/-/issues2022-12-04T23:07:09Zhttps://lab.civicrm.org/dev/core/-/issues/1634Evaluate if any indexed fields are unused2022-12-04T23:07:09ZeileenEvaluate if any indexed fields are unused
**Proposal** (note this is being updated based on discussion & comments may refer to an earlier version)
1. Remove the following columns from the xml from civicrm_activity
* phone_id
* phone_number
* relationship_id
1. Remove th...
**Proposal** (note this is being updated based on discussion & comments may refer to an earlier version)
1. Remove the following columns from the xml from civicrm_activity
* phone_id
* phone_number
* relationship_id
1. Remove the index from the xml on
* medium_id
* is_deleted
1. During upgrade we drop the above columns, if empty.
**Follow ups to consider**
2. There are other columns in the civicrm_activity table that are case specific - we might consider indexing is_current_revision & original_id only when CiviCase is enabled
3. I've been doing some tests on searches and found that searching is faster if I DROP the contribution_status_id index - it might be interesting to test the activity_type_id index although I suspect it has a much greater cardinality & is more useful
**Impact of the above**
1. Data would not be lost but api fields would no longer access those fields
2. Developers who might be using them outside of core could be impacted - we can mitigate by communicating on the dev list & perhaps putting checks & deprecation notices onto sites with data in the fields for a few months before making any changes.
3. DB size would be reduced. Note that empty fields contribute notably to table size IF they are indexed
4. Dev confusion & efficiency is improved by not having unused stuff in core.
**Background**
Obviously that's not something we should rush into so I'll have to ping the dev list etc
Looking at our civicrm_activity table it appears that each index has a base size - of around a half a gig. From there, the index size increases based on how much data is in the table. So an index on an empty field is around 57% of the size of our largest index.
There are 5 fields that are indexed + empty in our database for the civicrm_activity table (
```
Original id used for CiviCase
Medium id
Phone id
relationship_id
is_deleted
```
Plus - is_current_revision is effectively null
So my first question is are these all used in other databases - e.g when civicase is in use.
I couldn't spot references to phone_id and it feels 'wrong' to me anyway as I think you would want to either link to the contact or have a hard reference. I wonder if some of these fields are quietly obsolete?
It's very unsafe to drop core fields. However, I'm pondering dropping the indexes on these fields
@DaveD I'd appreciate your thoughts....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/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/4422Is there any reason to save both html and text versions of Inbound Emails?2023-07-13T17:33:27ZlarsssandergreenIs there any reason to save both html and text versions of Inbound Emails?For Email-to-Activity processing, when the email being processed has both html and text versions, both are saved to the details for the activity using the `-ALTERNATIVE ITEM 0-` ... `-ALTERNATIVE ITEM 1-` delimiters (depending on the det...For Email-to-Activity processing, when the email being processed has both html and text versions, both are saved to the details for the activity using the `-ALTERNATIVE ITEM 0-` ... `-ALTERNATIVE ITEM 1-` delimiters (depending on the details of the email, sometimes it seems to fail to recognize that both are present). This is handled while viewing activities (you only get the first version, which is not ideal as it is often the text version), but not in SearchKit.
I don't see any reason to keep two versions of the same email, so my proposal is just to keep the html version if both are present. Simple is better here unless there is some use case for having both.
If there is a need for the text version, perhaps we could add a setting for the mail account that would select text or html if both are present.https://lab.civicrm.org/dev/core/-/issues/4511Allow multiple 'Added By' for an activity2023-09-08T20:35:49ZyashodhaAllow multiple 'Added By' for an activityThe way some clients are using the CRM, the 'Added By' person(s) is/are really the person(s) responsible for making the activity happen, and the 'Assigned To' are people that participate in the activity but are not directly responsible f...The way some clients are using the CRM, the 'Added By' person(s) is/are really the person(s) responsible for making the activity happen, and the 'Assigned To' are people that participate in the activity but are not directly responsible for it.
The issues is that the CRM only allows ONE Added By, so they rely on some custom contact reference fields 'Partnered With' to supplement the Added By. But this is not a good solution and has many limitations e,g not being able to see the activity in Partner tab etc.
Therefore the best way to move forward is to allow multiple 'Added By' for an activity. The database schema already allows for that with the _activity_contact_ table.
From technical perspective, I reckon it was an oversight to not allow multiple contacts for Contact Source as we had moved civicrm_activity.source_contact_id (single), civicrm_activity_target.contact_id, civicrm_activity_assignee.contact_id (dropped civicrm_activity_target/civicrm_activity_assignee tables) in favor of civicrm_activity_contact table.
Screens that need to be modified:
- Activity tab in the Contact screen
- Activity View screen
- Activity Edit screen
- Activities reports
- Activities resultyashodhayashodhahttps://lab.civicrm.org/dev/core/-/issues/4580Assignee not exposed in activity import2023-09-14T13:02:53ZandyburnsAssignee not exposed in activity importThe record_type_id allows for source and target but not assignee? Wondering the history and reasoning behind this? https://forum.civicrm.org/index.php?topic=29394.0
It is possible to use the API CSV Import extension instead which previo...The record_type_id allows for source and target but not assignee? Wondering the history and reasoning behind this? https://forum.civicrm.org/index.php?topic=29394.0
It is possible to use the API CSV Import extension instead which previously may have hit issues with this: https://civicrm.stackexchange.com/questions/42834/issue-with-api-csv-importer-and-activity-imports/45547#45547.https://lab.civicrm.org/dev/core/-/issues/4847Activity-based SearchKit results for 'restricted' users (via the Related Perm...2024-02-08T21:01:05ZpetednzActivity-based SearchKit results for 'restricted' users (via the Related Permissions Module) are no longer restricting results to only Activities of Contacts the user has access tohttps://chat.civicrm.org/civicrm/pl/wj4t3rrh7ir5uyz7t88c7fuj8o
We are using the "Related Permissions Module" https://civicrm.org/extensions/relationship-permissions-acls
Beyond that all we are doing is
- use relationship A to join X (...https://chat.civicrm.org/civicrm/pl/wj4t3rrh7ir5uyz7t88c7fuj8o
We are using the "Related Permissions Module" https://civicrm.org/extensions/relationship-permissions-acls
Beyond that all we are doing is
- use relationship A to join X (teacher) to Y (school)
- use relationship B to join Y (school) to Z (student)
- give X necessary permissions to see All Activities but not see All Contacts.
This means that in pure civicrm when X logs in they only see their Students and the relevant Activities.
- Add an SK to show My Contacts and confirm that X only sees their Students - PASS
- Add an SK to show My Activities (I can export but it is super simple) and confirm that X only sees Activities where their Students are the Target - FAIL - they now see all Students with specified Activity
This was the query from the above which worked up till last week when we ran a civi upgrade.
```
SELECT a.id AS id, a.subject AS subject, a.activity_type_id AS activity_type_id:label, Activity_ActivityContact_Contact_01.sort_name AS Activity_ActivityContact_Contact_01.sort_name, Activity_ActivityContact_Contact_01.id AS Activity_ActivityContact_Contact_01.id
FROM civicrm_activity a
INNER JOIN (civicrm_activity_contact Activity_ActivityContact_Contact_01_via_activitycontact INNER JOIN civicrm_contact Activity_ActivityContact_Contact_01 ON (Activity_ActivityContact_Contact_01_via_activitycontact.contact_id = Activity_ActivityContact_Contact_01.id)) ON Activity_ActivityContact_Contact_01_via_activitycontact.record_type_id = "3" AND Activity_ActivityContact_Contact_01_via_activitycontact.activity_id = a.id
LEFT JOIN civicrm_value_attendance_record_15 Attendance_record_1 ON a.id = Attendance_record_1.entity_id
WHERE (a.activity_type_id = "51")
AND (Attendance_record_1.week_commencing_124 BETWEEN "20231203" AND "20231209")
AND (a.is_test = "0")
AND (a.is_deleted = "0")
```colemanwcolemanw