CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Drupal Hooks from Civicrm
Pages: [1]

Author Topic: Drupal Hooks from Civicrm  (Read 1077 times)

ghornet

  • Guest
Drupal Hooks from Civicrm
August 23, 2010, 11:04:06 am
Is it possible to call drupal hooks from inside of the civicrm code?

When I try to call the votingapi_add_vote it does not seem to recognize the function.

Thanks,

Civi\Drupal newbie Damian

TwoMice

  • I post frequently
  • ***
  • Posts: 214
  • Karma: 16
    • Emphanos
  • CiviCRM version: Always current stable version
  • CMS version: Drupal 7
Re: Drupal Hooks from Civicrm
August 23, 2010, 11:09:14 am
Hi ghornet,

You should be able to call drupal hooks from inside any drupal module.  Is that what you're trying to do?

Could you post a little snippet of the code you're using?  There's probably some small point you need to tweak to get it working.

- TM
Please consider contributing to help improve CiviCRM with the Make it Happen! initiative.

adixon

  • I post frequently
  • ***
  • Posts: 314
  • Karma: 19
    • Blackfly Solutions
Re: Drupal Hooks from Civicrm
August 30, 2010, 06:21:04 am
Okay, that's not a drupal hook. A drupal hook is a function that gets called by Drupal, and it would require your code to be in a drupal module that the drupal system has recognized (so it knows to call it!).

What you're calling there is a drupal module's api function - which at minimum requires that you have the module loaded, and maybe more depending on the module (i.e., read the documentation ...). There's a drupal_load function which is probably what you want to use to make sure the function is loaded.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Drupal Hooks from Civicrm

This forum was archived on 2017-11-26.