-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
dev/core#752 Add cid parameter when loading custom data via backend f… #15012
Conversation
(Standard links)
|
7a9ae68
to
3320adf
Compare
I feel like $contactID is a more common smarty variable |
Probably i guess i was just riffing based on the lab ticket |
…orms so that hooks can modifiy based on contact_id being viewed Add in handling for cid not being set Fix assign of cid and switch to using javascript if rather than smarty
3320adf
to
2fcb4a7
Compare
looking forwards to have this merged, tx @seamuslee001 ! |
Putting aside my preference for meaningful variable / parameter names - I'm OK to merge this if you review it @sluc23 |
yes, it works.. this hook will set function testhook_civicrm_buildForm($formName, &$form) {
if ($formName == 'CRM_Custom_Form_CustomDataByType') {
if ($form->getAction() == CRM_Core_Action::ADD) {
foreach ($form->_elements as $index => &$element) {
if ($element->_attributes['name'] == 'custom_1_-1') {
// Set Contact ID as default value to a custom field
$element->_attributes['value'] = $form->getVar('_contactID');
}
}
}
}
} |
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.
tested!
Merging based on @sluc23 review @sluc, @seamuslee001 -is there something here that could be documented? |
@eileenmcnaughton do you think is a good idea to add the hook sample i've posted in the |
only issue, so far, is that only works for Activities, until we spread this for the rest of entities.. I will doing some PRs to extend it for the rest.. |
@MegaphoneJon any opinions about where / how to document? |
…orms so that hooks can modifiy based on contact_id being viewed
Overview
This picks up work by @sluc23 from #13191, this adds the cid parameter into customdata urls as per discussion in lab
Before
no cid parameter
After
cid parameter
Technical Details
If the PR introduces noteworthy technical changes, please describe them here. Provide code snippets if necessary
Comments
ping @mattwire @eileenmcnaughton @sluc23