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 (Moderator: Donald Lobo) »
  • civicrm_developer module
Pages: [1]

Author Topic: civicrm_developer module  (Read 1398 times)

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
civicrm_developer module
April 07, 2011, 03:00:50 pm
One question people often ask about is what hooks are called when. I got sick of sticking in debug into my code to see when things were being called & what values to pass so I stuck it in a module that I can turn on and off (with drush). It's not very smart & it requires devel module - but it's handy

https://svn.fuzion.co.nz/repos/fuzion-code/trunk/drupal/modules/custom/civicrm_developer
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

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: civicrm_developer module
April 07, 2011, 04:06:06 pm
Looks very nice. Your server has a self-signed cert, however, and generates a warning in FF. :(
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.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: civicrm_developer module
April 07, 2011, 04:06:45 pm
It's not a hugely public repo so I think I'll just expect people to cope....
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

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: civicrm_developer module
April 07, 2011, 04:07:24 pm
LOL!
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.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: civicrm_developer module
April 07, 2011, 04:08:19 pm
If someone knows how to test if Civi debug is on I'll add that in so the module is 'quiet' if debug is off
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

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: civicrm_developer module
April 08, 2011, 03:16:08 pm
In smarty templates, we do this:

{if $config->debug}

So I suspect you can check the boolean in config object in PHP as well.
Protect your investment in CiviCRM by  becoming a Member!

totten

  • Administrator
  • Ask me questions
  • *****
  • Posts: 695
  • Karma: 64
Re: civicrm_developer module
April 12, 2011, 12:59:51 pm
That looks like a handy module.

I did something similar once. It's probably overkill in most situations, but it helped me understand a pernicious problem during a 2.1 => 2.2 transition. At the time, I was struggling to understand some subtle variations in $objectRef across various call contexts (e.g.  $objectRef in hook_civicrm_pre in the context of quick-add vs edit-contact vs API-call vs various profile-forms -- in v2.1 and v2.2 running on different installations); I initially tried to sprinkle dpm() calls into the code, but it was too hard to remember and compare the dpm() output from each call context.

The solution was to log all the hook invocations, including backtraces, hook parameters, and global variables.  This became the devel_hook module.  The various invocations could be browsed and compared after-the-fact, e.g.

 * Browse invocations: http://arms.dl.locker10.com/devel/hook-invocations.png
     (Note: Example shows pre/post hooks Civi 2.2 for two different page requests.)
 * View details: http://arms.dl.locker10.com/devel/hook-backtrace.png
 * Module code: http://arms.dl.locker10.com/devel/devel_hook-r2630.tar.gz

I don't think devel_hook is ideal for many situations -- it's certainly not as easy-to-use as civicrm_developer.  Never-the-less, it can be helpful when you know that your hook will be called in several contexts.

JoeMurray

  • Administrator
  • Ask me questions
  • *****
  • Posts: 578
  • Karma: 24
    • JMA Consulting
  • CiviCRM version: 4.4 and 4.5 (as of Nov 2014)
  • CMS version: Drupal, WordPress, Joomla
  • MySQL version: MySQL 5.5, 5.6, MariaDB 10.0 (as of Nov 2014)
Re: civicrm_developer module
July 27, 2011, 07:26:54 pm
Just noticed this now and wanted to say Thanks! And to bump the post so others see it as well.
Co-author of Using CiviCRM https://www.packtpub.com/using-civicrm/book

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • civicrm_developer module

This forum was archived on 2017-11-26.