Data from custom fields is not stored in event but in event template
When creating a new event using an event template which includes custom fields, the data entered in the custom fields won't be stored in the event itself when clicking the 'Continue'-button, but are stored in the event template. After clicking 'Continue' and then going back to the 'Info and Settings'-tab all data entered in the custom fields is gone. However, the data can be found in the used event template now. By going into edit mode the data is set in the template's custom fields and will be prefilled in the next event generated using this template.
This issue might be conneted to this one: Core Issue 766
See also a related post on stackexchange
Notice that custom field are 'only' lost in this cases, while it gets stored in the template in this one.
Steps to reproduce:
- Set up fresh Joomla instance (V. 3.9.26 at the time of writing)
- Install latest CiviCRM for Joomla (V. 5.37.2 at the time of writing)
- Create a new set of custom fields (I've been using text, date and select inputs in my tests)
- Create a new event template and fill out all necessary inputs (I've also entered something in the title, summary and description).
- Create a new event using the newly created template. Enter something in all necessary fields as well as in the custom fields.
- Click 'Continue'
- Return to 'Info and Settings' - the data entered in the custom fields is gone :/
- Open the template in edit mode. The custom data we previously entered in the event is here now
This issue can be reproduced in CiviCRM 5.37.0 and 5.37.2, but not in 5.36.1 used in the Joomla Demo. I've been using the following environments to test: AMPPS 3.9 and XAMPP (compile date 4-6-21) with PHP 7.3. As I'm only using CiviCRM inside Joomla I haven't testet whether this issue also appears in other CMS- or the standalone-version.
A possible workaround for the problem is to skip entering something in the custom fields in Step 5 but doing so in Step 7. The contents of custom fields are saved correctly now. However, another strange behaviour occurs now: If there is any content of the custom fields already set in the template (e.g. if a field is set as required), this data is missing in the event using the template. Even in fields marked as required - the content set in the template is just gone.