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) »
  • how to deal with more hooks in Drupal module?
Pages: [1]

Author Topic: how to deal with more hooks in Drupal module?  (Read 772 times)

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
how to deal with more hooks in Drupal module?
February 18, 2013, 10:29:06 am
Just a question that comes to mind and I wonder if anyone has any recommendations....

when using hooks for customizations, do you tend to put them all into one Drupal module or do you create a separate module per hook....or something in between? I think it would make sense to create a module when hooks sort of hang together functionally, but sometimes this is hard to distinguish. Just wondered if there is a standard or recommended approach....
Thanks!
Erik
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: how to deal with more hooks in Drupal module?
February 18, 2013, 11:33:53 am
Warm beer. ie. something inbetween
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: how to deal with more hooks in Drupal module?
February 18, 2013, 11:35:47 am
Hmmm warm beer or a fat wife, that is the question :-)
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: how to deal with more hooks in Drupal module?
February 19, 2013, 03:33:52 am
Quote from: Erik Hommel on February 18, 2013, 10:29:06 am
when using hooks for customizations, do you tend to put them all into one Drupal module or do you create a separate module per hook.

I almost always use one module. Unless there are two clearly distinct sets of customizations that I am implementing, I prefer to have all custom code in one place as that's easiest for maintenance and future debugging.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Erik Hommel

  • Forum Godess / God
  • I live on this forum
  • *****
  • Posts: 1773
  • Karma: 59
    • EE-atWork
  • CiviCRM version: all sorts
  • CMS version: Drupal
  • MySQL version: Ubuntu's latest LTS version
  • PHP version: Ubuntu's latest LTS version
Re: how to deal with more hooks in Drupal module?
February 19, 2013, 05:00:30 am
Thanks Hershel, makes sense. That is what I have done so far :-)
Consultant/project manager at EEatWork and CiviCooP (http://www.civicoop.org/)

torenware

  • I post frequently
  • ***
  • Posts: 153
  • Karma: 4
Re: how to deal with more hooks in Drupal module?
February 23, 2013, 12:10:30 am
I guess the only reason that you might want to use more than one module is if you think you're going to reuse some your hook implementations for other projects or other customers.  The bigger the module, the harder it is to reuse without modifying it.

But if it's just your site -- go as big as you like!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • how to deal with more hooks in Drupal module?

This forum was archived on 2017-11-26.