Questions tagged [hooks]

Hooks are a powerful way to extend CiviCRM's functionality, incorporate additional business logic, and even integrate CiviCRM with external systems. The way they work is, that at key points in processing CiviCRM checks if custom code is "hooked in", and runs any valid code it finds.

21 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
2answers
56 views

Can't change help_post text in Price Set using the civicrm_buildAmount hook

There are several fields I expect to be able to change in the buildAmount hook that just won't change for me. One example: function myext_civicrm_buildAmount($pageType, &$form, &$amount) { $...
3
votes
0answers
23 views

Building the equivalent of a webhook for certain CiviCRM events

I posted this in the Mattermost Town Square, but was encouraged to post the question here also: Good afternoon. I'm wondering if CiviCRM can produce a "changes stream" or fire off a webhook ...
3
votes
1answer
54 views

What is deleting my Tag?

I've run into this twice this month and scratching my head. Read this image upside down: We hit post create Address hook -> my regex extension creates a Tag - all good; happy dance; then something in ...
3
votes
1answer
61 views

Implementing tokens and tokenValues hooks for Event custom field

I'm trying to implement a hook for inserting Event custom fields into Scheduled reminders; however, I'm not a developer so I'm really not sure what the code needs to look like. The custom field is ...
2
votes
0answers
26 views

How to use a GROUP_BY / HAVING in extended Advanced Contact Search query?

Based on this solution, I'm trying to add a custom pan in advanced search in order to filter by Line Item Total Sum. The context I successfully manage to filter by Line Item Total with these fields: ...
2
votes
0answers
34 views

Change displayed value for customfield

I have a custom field of an individual that stores the ID of a group (as int). I would like to change the display of the field to show the actual name of the group instead of the ID (same as contact ...
2
votes
3answers
134 views

How to customise the activities tab listing

I used to hack the Activities BAO to change the search results to make the subject line something more useful; i.e. extract other data from particular activity types and auto-create a summary in place ...
2
votes
0answers
76 views

creating case types with different component than CiviCase for attached activity types

We created an extension for tasks management which define a new civicrm component called CiviTask .. I want to create 4 case types (with attached activity Types set and a standard timeline ) when ...
2
votes
0answers
34 views

Trying to understand CiviAccounts workflow

I've read the CiviAccounts Data Flow document and I'm trying to figure out the order things get done. Here's my situation: My organization collects membership dues at a national level. But part of ...
2
votes
0answers
57 views

Adding a credit card surcharge to event registrations

I'm using a number of hooks to set a credit card surcharge to an event registration. I have it mostly working, however there are some cosmetic issues remaining. Using hook_civicrm_preProcess, I have ...
1
vote
0answers
17 views

Errors not showing against custom fields using hook validateForm()

Using this code if ($fields["custom_111_79"] == 0) $errors["custom_111_79"] = "Please enter number of physio sessions"; The evaluation is done correctly, but the error message does not appear ...
1
vote
0answers
28 views

Stripe Webhooks on a multisite?

I've just updated a multi-site with the latest Stripe extension and I get the message to update the webhooks. Did this on another site earlier I was able to just follow the links and it updated as it ...
1
vote
0answers
107 views

Which civicrm hook for Event Registration form field content change in Drupal module?

Preamble: Event Registration Settings form ( civicrm/event/manage/settings?reset=1&action=update&id=EVENT-ID ) has separated text areas for Event Summary/Description ( "Info and Settings" ...
1
vote
0answers
113 views

Setting Default Value BuildForm Hook does not work

I tried to implement the following hook (in my extension "cividoncamillo"), to set a default Contribution Type, but it does not work... Any Ideas why not? //does not work function ...
1
vote
0answers
31 views

How am I meant to use $mask in hook_civicrm_links?

I don't really understand what the point of the $mask variable that is passed to hook_civicrm_links is. Can anyone explain it to me? PS I understand how to use the other variables and I might not need ...
1
vote
0answers
143 views

How to connect with state and country table

We are using CiviCRM (4.7.9) with WordPress (4.5.3). We are pulling the data from the CiviCRM state and country tables into Gravity Forms using code in our function.php. But we are running into ...
1
vote
0answers
63 views

Overriding civicrm_webform's postprocessing of contributions

I'm using hook_form_alter() to perform calculations on various contributions on a civicrm_webform. I'd like to use the totals of these calculations to update the contribution amount and event amounts ...
1
vote
0answers
68 views

Event Listing - Number of Participants

Is there a way to add a column to the front end Event Listing that shows the total number of participants registered for that row's event? This is the com_civcrm >> Event Listing menu item. The ...
0
votes
0answers
51 views

Creating membership with civicrm_api3, inherited membership

I'm trying to create inherited memberships in the civicrm_post hook. I feel like there is something wrong with the api itself. The API doesn't even recognize my only membership id in the database. ...
0
votes
1answer
20 views

How to call my post_provision_install hook after CiviCRM installed?

I want to automate the removal of households from CiviCRM, right after it has been installed via Aegir on Drupal 7. I implemented my post_provision_install hook, but it runs before the same hook of ...
0
votes
0answers
34 views

How to alter a query in hook_civicrm_pageRun based on a custom filter provided?

I want to alter the query run in the hook_pageRun(&$page) under Manage Events Page to alter the (event list) results shown here. I can alter the rows from hook_civicrm_pageRun , but I want to ...