There is a https://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_buildForm manual page, but not sure I've got it right.

Say, there is a value in a custom function, which should be set as default in a form, built using hook_buildForm (where form itself opens in a modal frame and outside civicrm/ path).

I've a suspicions CRM_Utils_Array::value might be used to set a custom variable somewhere (anywhere) and get it later on wherever it might be needed;

Have an attempt to set value outside of hook_buildForm like this:

$myVeryOwnPid = CRM_Utils_Array::value('myveryownpid', $contact['contact_id_b'], $contact['contact_id_b']); 

and get it from inside hook_buildForm:

  $myVeryOwnPid = CRM_Utils_Array::value('myveryownpid', $_GET, '0');

..but, of course, nothing works, just because I clearly don't understand, how it should work. As they say, CRM_Utils_Array is the most often used feature in CiviCRM, but digging inside a source code Ive realized there is no forest for the trees (at least, for me). Any advice, please!

1 Answer 1


Found an answer here https://wiki.civicrm.org/confluence/display/CRMDOC/Update+custom+fields+in+contributions+and+events+by+passing+variables+in+a+URL

Nothing to do with CRM_Utils_Array though; just plain simple passing vars via an URL.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.