3

Recently we updated CiviCRM from 4.1 to 4.7 (yeah, we really need it).

We have custom code in the pre and post hooks that validates some contact fields.

Now, in the last version of CiviCRM, you can edit the fields inline, but we noticed that we have to duplicate our code if we want to edit inline.

My question is, is there anyway to not duplicate the code for the inline edit? Is there some hook that triggers both the inline and the edit fields?

3

If you use the validateForm hook you can probably use the same code if you include both forms in your if-statement, like so:

if ($formName == "CRM_Contact_Form_Inline_Address" || $formName == "CRM_Contact_Form_Edit_Address") {

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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