Error Saving Custom Field Group with Event Name that's disabled
Overview
After disabling an event, an error is raised when trying to reuse a custom field group for a new event. It returns a message
Supplied Sub type is not valid for the specified entity
When trying to save on Civi 5.70 in Wordpress, this box was raised:
The error message is presented after clicking through it in the pop up civi alerts.
Reproduction steps
- Create Event 1 copy it to Event 1 Copy
- Create a Custom Field Set attach Participant -> Partipants (Event Name) Pick Event 1
- Disable Event 1
- Go back and add Event 1 Copy to Custom Field Set
- Got an error "message: Supplied Sub type is not valid for the specified entity".
Current behaviour
What happens currently. Please provide error messages, screenshots or gifs (LICEcap, SilentCast) where appropriate.
***ERROR***
message: Supplied Sub type is not valid for the specified entity
code:
exception: CRM_Core_Exception Object
(
[message:protected] => Supplied Sub type is not valid for the specified entity
[string:Exception:private] =>
[code:protected] => 0
[file:protected] => /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/api/api.php
[line:protected] => 138
[trace:Exception:private] => Array
(
[0] => Array
(
[file] => /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Custom/Form/Group.php
[line] => 293
[function] => civicrm_api3
)
[1] => Array
(
[file] => /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php
[line] => 641
[function] => postProcess
[class] => CRM_Custom_Form_Group
[type] => ->
)
[2] => Array
(
[file] => /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/StateMachine.php
[line] => 144
[function] => mainProcess
[class] => CRM_Core_Form
[type] => ->
)
[3] => Array
(
[file] => /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Next.php
[line] => 43
[function] => perform
[class] => CRM_Core_StateMachine
[type] => ->
)
[4] => Array
(
[file] => /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php
[line] => 203
[function] => perform
[class] => CRM_Core_QuickForm_Action_Next
[type] => ->
)
[5] => Array
(
...
Expected behaviour
What should happen.
I should be able to add a new event to the custom field group even though the old event is disabled.
Environment information
- Browser: Firefox 122.0.1
- CiviCRM: 5.70.0/5.72.0...
- PHP: 8.1.1_
- CMS: Wordpress 6.4.3
- Database: MariaDB...
- Web Server: Apache...
Comments
Anything else you would like the reviewer to note.