I use the CiviCRM module for my site. Many of the top level menu options for CiviCRM include URL parameters such as:

/civicrm/contact/search?reset=1
/drupal/civicrm/group?reset=1

the Administration Menu module seems to truncate these links and eliminate the parameters from the end of the URL string. These parameters are necessary for the proper function of the module.

Is there any way to turn off your module's behavior of eliminating this truncation?

Thanks!

Comments

stoob’s picture

Link as appears in the administration menu (note lack of ?reset=1)

/civicrm/contact/search

sun’s picture

Status: Active » Postponed (maintainer needs more info)

Could you please test with 3.x? Thanks.

stoob’s picture

I tested with 3.x and the admin_menu module still doesn't work with CiviCRM -- still truncates the ?reset=1 parameter on all the CiviCRM menu links. Hopefully this fix can be part of your next release. Thanks.

stoob’s picture

Status: Postponed (maintainer needs more info) » Active
stoob’s picture

Hi, is this issue of your module removing ?parameters=X from the link code going to be addressed in 6.x-1.5? It was reported for 1.3 but not addressed in 1.4. It is a verified bug, currently unassigned. Please give an update, thanks!

sun’s picture

Title: 1.3 version removes URL parameters from menu links on CiviCRM module » Query strings removed from menu links of CiviCRM module
Version: 6.x-1.3 » 6.x-3.x-dev
Status: Active » Postponed (maintainer needs more info)

I don't use CiviCRM, so I am unable to debug this.

Also, I don't quite understand this issue. admin_menu contains administrative links only. The path of the links you mentioned do not start with admin/*, so they should not be contained in the menu.

That said, please note that there won't be another release for 1.x. 1.4 was the last of the 1.x series. Development is actively happening in 3.x.

xurizaemon’s picture

Title: Query strings removed from menu links of CiviCRM module » Query strings removed from menu links

sun,

Would you consider a patch for 3.x-dev which made it possible to pass in a query entry for each of the links arrays returned from hook_admin_menu()? I believe that's all we need to make CiviCRM (or any other tool which uses a query string) and admin_menu play well together.

Currently we hand back:

$links = array( 
  /* ... */
  array( 
    'title' => 'Find Contacts',
    'path' => 'civicrm/contact/search' 
    // would like to add "?reset=1" here,
    'weight' => 30,
    'parent_path' => 'CiviCRM',
  ),
  /* ... */
) ;
 

Just appending "?q=abc" onto the end of the path will result in it being URL encoded, so that's not what we want.

While the actual menu entries are not located inside the admin/* space, the functionality is administrative and the distinction between what's in admin/* and what isn't is fairly opaque to most users.

Exposing CiviCRM functionality via admin_menu occupies the same space as exposing menu entries like node/add (which is not an admin/* path either). Many CiviCRM users really appreciate the integration of admin_menu and CiviCRM, and we'd like to improve on that.

sun’s picture

Status: Postponed (maintainer needs more info) » Active

I didn't even know that any module implemented that hook. Good to know, because I already thought about rewriting that.

Why can't you do it the same way as admin_menu does it?

  $links[] = array(
    'title' => 'Flush all caches',
    'path' => 'admin_menu/flush-cache',
    'options' => array(
      'query' => 'your-query=string-here',
    ),
  );
xurizaemon’s picture

Assigned: Unassigned » xurizaemon
Status: Active » Closed (fixed)

patch supplied to CiviCRM @ http://issues.civicrm.org/jira/browse/CRM-4513 so fix not required in admin_menu

thanks sun, much appreciated