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) »
  • hook_civicrm_links Not Working for Me.
Pages: [1]

Author Topic: hook_civicrm_links Not Working for Me.  (Read 1635 times)

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
hook_civicrm_links Not Working for Me.
July 07, 2009, 07:42:20 am
If I use this code:

Code: [Select]
function mymod_civicrm_links($op, $objectName, $objectId ) {
  echo 'here';die;
  switch ($op) {
    case 'tabs.contact.activity':
      echo 'works';die;
  };
}

and I load civicrm/contact/view?reset=1&cid=550 then I see just the word 'here' in my browser. If I remove that line and load the page again then it doesn't die. But I think it's supposed to. A bit of debugging shows that the values passed to that function are:

op = view.contact.activity
objectname = Contact
objectId = 550 

and it appears to only be called once. I am running CiviCRM 2.2.6 and Drupal 6.12 (haven't updated either to the very latest just yet--this is a dev site anyhow).

Am I missing something? This function is supposed to also be called with $op set to 'tabs.contact.activity,' no?
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.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: hook_civicrm_links Not Working for Me.
July 07, 2009, 08:05:24 am

i've fixed the documentation to reflect what we do currently.

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: hook_civicrm_links Not Working for Me.
July 07, 2009, 10:30:14 am
I am looking at http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+hook+specification#CiviCRMhookspecification-hookcivicrmlinks and it says there that the sample code "Adds a new tab." Running that sample code on my site indeed adds a link to the main View screen, but it doesn't add a tab. it didn't seem to add a link before either, but now running the exact sample code there does work.

I was using similar code in 2.0 to add a tab and I am now trying to upgrade that code to D6 and CiviCRM 2.2.

The code here http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+hook+specification#CiviCRMhookspecification-hookcivicrmtabs does add a tab (if you remove the unset() line first of course) and is working just fine for me.

If that is the expected behavior, let me know and I can update the docs.
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.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: hook_civicrm_links Not Working for Me.
July 07, 2009, 11:55:55 am

yes, this is the desired behavior. can you please update the docs

thanx

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: hook_civicrm_links Not Working for Me.
July 07, 2009, 12:02:52 pm
http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+hook+specification updated
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.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • hook_civicrm_links Not Working for Me.

This forum was archived on 2017-11-26.