Deleted sub types Error saving Custom Field Group
Overview
I have a deleted event that was attached to a custom group, probably a test event. When trying to add a new event to that custom group, it reports a sub type error.
Supplied Sub type is not valid for the specified entity
I did some error checking with coleman over on this comment thread.
Reproduction steps
- Click on Custom Data -> New Field Set.
- Entered Participant and Event Name and clicked Fall Solstice.
- Copy that event, and delete the old one.
- Return to Custom Data -> Field Set -> Add new copy of Fall Solstice.
- Click save, error
Work around:
- clear Type Event Name and re-select all events you wanted to have it attached to.
Current behaviour
Oooooh, that is it! I was able to replicate that on smaster. what doesn't help is that the list of events doesn't show the deleted one:
CRM_Core_Exception: The Sub Type ID 8 is not valid for the specified entity or it has been disabled. If the Sub Type was disabled, re-enable it temporarily and re-save this form in order to remove the setting. in /srv/buildkit/build/smaster/web/core/CRM/Custom/Form/Group.php on line 293
Exception trace
# Function Location
0 civicrm_api3() /srv/buildkit/build/smaster/web/core/CRM/Custom/Form/Group.php:293
1 CRM_Custom_Form_Group->postProcess() /srv/buildkit/build/smaster/web/core/CRM/Core/Form.php:647
2 CRM_Core_Form->mainProcess() /srv/buildkit/build/smaster/web/core/CRM/Core/StateMachine.php:144
3 CRM_Core_StateMachine->perform() /srv/buildkit/build/smaster/web/core/CRM/Core/QuickForm/Action/Next.php:43
4 CRM_Core_QuickForm_Action_Next->perform() /srv/buildkit/build/smaster/web/core/packages/HTML/QuickForm/Controller.php:203
5 HTML_QuickForm_Controller->handle() /srv/buildkit/build/smaster/web/core/packages/HTML/QuickForm/Page.php:103
6 HTML_QuickForm_Page->handle() /srv/buildkit/build/smaster/web/core/CRM/Core/Controller.php:356
7 CRM_Core_Controller->run() /srv/buildkit/build/smaster/web/core/CRM/Utils/Wrapper.php:98
8 CRM_Utils_Wrapper->run() /srv/buildkit/build/smaster/web/core/CRM/Core/Invoke.php:278
9 CRM_Core_Invoke::runItem() /srv/buildkit/build/smaster/web/core/CRM/Core/Invoke.php:71
10 CRM_Core_Invoke::_invoke() /srv/buildkit/build/smaster/web/core/CRM/Core/Invoke.php:36
11 CRM_Core_Invoke::invoke() /srv/buildkit/build/smaster/web/core/Civi/Standalone/WebEntrypoint.php:79
12 Civi\Standalone\WebEntrypoint::invoke() /srv/buildkit/build/smaster/web/core/Civi/Standalone/WebEntrypoint.php:20
13 Civi\Standalone\WebEntrypoint::index() /srv/buildkit/build/smaster/web/index.php:35
14 {main}
The Sub Type ID 8 is not valid for the specified entity or it has been disabled. If the Sub Type was disabled, re-enable it temporarily and re-save this form in order to remove the setting.
Return to home page.
In http response of the page, it sends the id of the deleted event to the field
but after some page loading, it doesn't show that to the user in the select2 box, so the user wouldn't know it is trying to be attached.
it's style is display:none to the user on the hidden input field of the select 2 widget
The value field of the input received the page response. see value="9"
which was deleted.
<input placeholder="Any" class="crm-select2 crm-form-select2" data-select-params="{"data":[{"id":"1","text":"Fall Fundraiser Dinner"},{"id":"2","text":"Summer Solstice Festival Day Concert"},{"id":"3","text":"Rain-forest Cup Youth Soccer Tournament"},{"id":"10","text":"Copy of Copy of Copy of Fall Fundraiser Dinner w\/ cfg"}],"multiple":true}" name="extends_entity_column_value" type="text" value="9" id="extends_entity_column_value" tabindex="-1" style="display: none;">
to resolve the save error on standalone, i had to click clear the participant subtype option of "event name" in order to clear the array and reselect the events that I intended for it to be on.
Expected behaviour
What should happen.
Maybe show strikethrough that there's a deleted event? Idk if thats possible. Otherwise don't return the id of the deleted event to the page load.
Environment information
- Browser: Firfox
- CiviCRM: Standalone Master 6.1.alpha1 / 5.82.0
- CMS: Wordpress 6.7.2/Standalone