-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Entity subtype is a required API field #138
Comments
Subtypes are actually a requirement for entities of an ECK entity type being created, see #5. The analogy is that you can't have e.g. activities without an activity type. So the Afform for listing entities probably shouldn't be available until subtypes are created, or at least a notice being shown that a subtype is required. I can't see how the add/edit form for an ECK entity type should behave differently with subtypes being required, as you'll have to be able save the entity type before creating subtypes for it. But I'm happy to receive suggestions for that. Maybe a notice on the form would suffice? |
Just hit the same thing - create an entity & create a FormBuilder submission form to create new instances. On hitting 'Submit' it says 'Saved' but silently fails, except for a message in the log saying: For my entity, there is no obvious subtype. I might eventually want a subtype but requiring one is not intuitive. If you need one from an ease of coding perspective (as suggested in #5), then maybe create a 'default' type automatically that can be renamed or removed by those that need subtypes. |
The core afform code has this comment: // What to do here? Sometimes we should silently ignore errors, e.g. an optional entity
// intentionally left blank. Other times it's a real error the user should know about. I'd say that core afform should not ignore the exception when mandatory values are missing for the entity. The exception comes with the I wouldn't want to re-implement the |
I created civicrm/civicrm-core#31479 for FormBuilder forms to not silently fail with missing mandatory values. |
When you create a new entity, you're given the option (but it's not required) to create a subtype.
However, if you don't create a subtype:
The text was updated successfully, but these errors were encountered: