CiviEvent: API3/4 deletes event is_template flag on event update
Overview
The CiviCRM API resets(!) the is_template
flag on an event entity when manipulating unrelated attributes. Tested on APIv3 and APIv4.
Reproduction steps
- Create a new event template (not a message template)
- Go to the API explorer (3 or 4)
- Run
Event.get
with the ID of the given template. Observe that theis_template
parameter is set to 1/true. - Run
Event.create/update
with parameters:-
id
= ID of the given template -
title
= "just want to trigger a change"
-
- Run
Event.get
with the ID of the given template.
Current behaviour
Observe that the is_template
parameter is set to 0/false - the flag has been deleted!
Expected behaviour
API call should leave the is_template
parameter alone, i.e. the return value of then is_template
parameter should be 1/true
Environment information
Tested on current DMASTER running 5.59.alpha1, but has definitely been around for longer.
Comments
A unit test to cover that should be pretty straightforward with these instructions.