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) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • mymodule_civicrm_pageRun is not called on all pages
Pages: [1]

Author Topic: mymodule_civicrm_pageRun is not called on all pages  (Read 991 times)

Triquanta

  • Guest
mymodule_civicrm_pageRun is not called on all pages
January 06, 2010, 05:23:03 am
Hello,
I try to pass some variables to my template but the pageRun hook is not called on every page. I added some debug code to /CRM/Utils/Hook.php in the pageRun function. That shows on pages like /civicrm/admin/uf/group&reset=1. But not on civicrm/profile/create/?reset=1&gid=12.
Is there any logic in that?

I am developing the hooks in a Drupal module.

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: mymodule_civicrm_pageRun is not called on all pages
January 06, 2010, 05:27:38 am
Check the examples from below file:
http://svn.civicrm.org/civicrm/trunk/drupal/civitest.module.sample

Kurund
Found this reply helpful? Support CiviCRM

Triquanta

  • Guest
Re: mymodule_civicrm_pageRun is not called on all pages
January 06, 2010, 05:48:31 am
Yes, i have seen that file. The problem is that the file /CRM/Utils/Hooks.php is not called on every page, so it seems. So the hook in my module is never called. I can see debug code from the hooks.php file on /civicrm/admin pages, but not on /civicrm/profile/create pages. So on that page my hook is not called.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: mymodule_civicrm_pageRun is not called on all pages
January 06, 2010, 07:10:33 am
CiviCRM screens are classified as either 'Pages' or 'Forms' for the most part. I think pageRun hook is called for 'Pages'. profile/create is a Form - so I think you need to use the buildForm hook.
Protect your investment in CiviCRM by  becoming a Member!

Triquanta

  • Guest
Re: mymodule_civicrm_pageRun is not called on all pages
January 06, 2010, 07:15:18 am
Yep, thanks that is what is happening. I will look into the buildForm hook to see if I can use that. Thanks.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • mymodule_civicrm_pageRun is not called on all pages

This forum was archived on 2017-11-26.