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) »
  • custom menus.xml not being picked up
Pages: [1]

Author Topic: custom menus.xml not being picked up  (Read 893 times)

SarahG (FountainTribe)

  • Ask me questions
  • ****
  • Posts: 782
  • Karma: 29
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 6, Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
custom menus.xml not being picked up
August 09, 2011, 06:44:38 am
I have written a Drupal module that implements the hook  "_civicrm_tabs"

The url for my custom tab is "civicrm/contact/financialsummarytab"

I have a custom menus.xml file that has the name of my callback class for this menu.

After installing the module,  I would call "http://mywebsite.org/index.php?q=civicrm/menu/rebuild&reset=1" and then the custom tab would start working.  All worked fine under 3.4.3.  But under 3.4.5,  my callback class never gets called. 

I have checked the "civicrm_menus" table, and it seems the row describing my callback class and custom url never got created.  Any ideas?

Did I help you? Please donate to the Civi-Make-It-Happen campaign  CiviCRM for mobile devices! 

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: custom menus.xml not being picked up
August 09, 2011, 10:33:38 am

r u using the xmlMenu hook to include your custom menu? if not, how are you doing it

your best bet might be to debug the menu rebuild code and figure out why your custom menu.xml is not being included

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

SarahG (FountainTribe)

  • Ask me questions
  • ****
  • Posts: 782
  • Karma: 29
  • CiviCRM version: 4.4.7
  • CMS version: Drupal 6, Drupal 7
  • MySQL version: 5.5
  • PHP version: 5.3
Re: custom menus.xml not being picked up
August 11, 2011, 10:30:29 pm
I am not using the xmlMenu hook, as I do not need a menu item to be visible to the end-user. I just want the CiviCRM controller to know about my callback class, so that it gets called when the end-user clicks my custom tab.

Should I use the xmlMenu hook in this situation?
Did I help you? Please donate to the Civi-Make-It-Happen campaign  CiviCRM for mobile devices! 

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: custom menus.xml not being picked up
August 12, 2011, 07:08:05 am

i think u need to use it, since civi is not aware of the existence of that file otherwise

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

totten

  • Administrator
  • Ask me questions
  • *****
  • Posts: 695
  • Karma: 64
Re: custom menus.xml not being picked up
August 12, 2011, 08:04:35 pm
Quote from: Sarah Gladstone on August 11, 2011, 10:30:29 pm
I am not using the xmlMenu hook, as I do not need a menu item to be visible to the end-user. I just want the CiviCRM controller to know about my callback class, so that it gets called when the end-user clicks my custom tab.

Should I use the xmlMenu hook in this situation?

Yes, you should.

I had some confusion on this, too, owing to the history behind it. In CiviCRM 2.x, hook_civicrm_xmlMenu had dual functionality -- mapping a path to a controller and advertising that path in the visible menu. In CiviCRM 3.x, the menu system underwent some major changes, and these two functions got split apart: the path-controller mappings still go through hook_civicrm_xmlMenu, but the visible menu moved to hook_civicrm_navigationMenu. For your situation, xmlMenu is appropriate, and navigationMenu is inappropriate.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • custom menus.xml not being picked up

This forum was archived on 2017-11-26.