-
-
Notifications
You must be signed in to change notification settings - Fork 825
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
Permit multi-record custom field sets to extend any entity (in theory) #27549
Conversation
🤖 Thank you for contributing to CiviCRM! ❤️ We will need to test and review this PR. 👷 Introduction for new contributors...
Quick links for reviewers...
|
if ($extends == 'Relationship' && !empty($this->_subtypes)) { | ||
$relationshipDefaults = []; | ||
foreach ($defaults['extends'][1] as $donCare => $rel_type_id) { | ||
$relationshipDefaults[] = $rel_type_id; | ||
} | ||
|
||
$defaults['extends'][1] = $relationshipDefaults; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is why the PR manages to add functionality and metadata while not overall increasing SLOC. I deleted a bunch of code like this which:
- Does nothing.
- Has done nothing for over a decade.
- Looks scary so everyone was afraid to touch it.
c500ef9
to
70641ae
Compare
@colemanw this seems to mostly work. I did find one issue which is I was just testing changing the Entity type around and if I selected Participants, then elected Role or Event name or some sub. Then changed the entity to be Contacts the extends select box still shows |
…i-record custom fields This is still only enabled for contacts, but now the switch could be flipped for other entities. Refactors the custom group form to be metadata-driven & respect the new setting (and cleanup lots of cruft).
70641ae
to
a641291
Compare
Thanks @seamuslee001 - fixed now. |
a641291
to
0129a2e
Compare
ok seems to work correctly now on my local merging |
Overview
Permits any entity to have multi-record custom field sets, by improving the underlying metadata.
Before
Multi-record custom sets were hardcoded in multiple places as "Contact only".
Crufty form for saving custom fieldsets.
After
Metadata exists about which entities support multi-record custom sets. This is still only enabled for contacts, but now the switch could be flipped for other entities.
Refactors the custom group form to be metadata-driven & respect the new setting (and cleanup lots of cruft). UX much nicer.
Comments
The motivation was to improve metadata, but it turned into a big cleanup project.