APIv4 - GroupContact - Does not set actual time part in subscription history date
Overview
The time part in the subscription history date is not set to the actual time when the change was triggered by APIv4 GroupContact. It is working fine, when doing so via UI or APIv3.
Reproduction steps
- Add your own contact to a group via APIv4
GroupContact::create
https://dmaster.demo.civicrm.org/civicrm/api4#/explorer/GroupContact/create?values=%5B%5B%22group_id%22,%224%22%5D,%5B%22contact_id%22,%22user_contact_id%22%5D%5D - Query Subscription History: https://dmaster.demo.civicrm.org/civicrm/api4#/explorer/SubscriptionHistory/get?where=%5B%5B%22contact_id%22,%22%3D%22,%22user_contact_id%22%5D%5D
- Date fields only contains correct date, time is set to 00:00:00
Works with Date and Time
- Add your own contact from the group tab on your contact page or add it to the group to via APIv3
GroupContact.create
- Query Subscription History: https://dmaster.demo.civicrm.org/civicrm/api4#/explorer/SubscriptionHistory/get?where=%5B%5B%22contact_id%22,%22%3D%22,%22user_contact_id%22%5D%5D
- Date fields contains date and time when contact was added to the group
Current behaviour
Subscription history date field only contains correct data when adding / removing / deleting to/from a group via APIv4 (GroupContact. Time is set as 00:00:00
.
Expected behaviour
Subscription history date field contains correct time and date, regardless of which way the contact was added / removed / deleted to/from a group.
Environment information
- Browser: Firefox 102.2.0
- CiviCRM: Master / https://dmaster.demo.civicrm.org
Comments
Anything else you would like the reviewer to note.