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) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 2.2 Release Testing »
  • Views 2 integration - incorrect link when selecting "Link this field to..."
Pages: [1]

Author Topic: Views 2 integration - incorrect link when selecting "Link this field to..."  (Read 1421 times)

DanilaD

  • I post occasionally
  • **
  • Posts: 93
  • Karma: 11
Views 2 integration - incorrect link when selecting "Link this field to..."
January 24, 2009, 10:14:06 am
Hello.

When I select "Link this field to its CiviCRM Contact" in field "Display Name", for example, the formed link

http://.../civicrm/contact/view?reset=1&cid=14

has incorrect cid. this cid (14) is in this case contribution id.

The exported view for this:

Code: [Select]
$view = new view;
$view->name = 'civicrm_contributions';
$view->description = 'Test view for contributions';
$view->tag = 'civicrm';
$view->view_php = '';
$view->base_table = 'civicrm_contribution';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
  'currency' => array(
    'label' => 'Amount',
    'exclude' => 0,
    'id' => 'currency',
    'table' => 'civicrm_contribution',
    'field' => 'currency',
    'relationship' => 'none',
  ),
  'total_amount' => array(
    'label' => 'Total Amount',
    'set_precision' => FALSE,
    'precision' => 0,
    'decimal' => '.',
    'separator' => ',',
    'prefix' => '',
    'suffix' => '',
    'exclude' => 0,
    'id' => 'total_amount',
    'table' => 'civicrm_contribution',
    'field' => 'total_amount',
    'relationship' => 'none',
  ),
  'display_name' => array(
    'label' => 'Display Name',
    'link_to_civicrm_contact' => 1,
    'exclude' => 0,
    'id' => 'display_name',
    'table' => 'civicrm_contact',
    'field' => 'display_name',
    'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
  'type' => 'role',
  'role' => array(
    '4' => 4,
    '3' => 3,
  ),
));
$handler->override_option('title', 'Contributions list');
$handler->override_option('header', 'Alpha version');
$handler->override_option('header_format', '1');
$handler->override_option('header_empty', 0);
$handler->override_option('style_plugin', 'table');
$handler->override_option('style_options', array(
  'grouping' => '',
  'override' => 1,
  'sticky' => 0,
  'order' => 'asc',
  'columns' => array(
    'sort_name' => 'sort_name',
    'currency' => 'currency',
    'total_amount' => 'currency',
  ),
  'info' => array(
    'sort_name' => array(
      'sortable' => 0,
      'separator' => '',
    ),
    'currency' => array(
      'sortable' => 1,
      'separator' => ' ',
    ),
    'total_amount' => array(
      'sortable' => 1,
      'separator' => '',
    ),
  ),
  'default' => '-1',
));
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->override_option('path', 'contributions');
$handler->override_option('menu', array(
  'type' => 'normal',
  'title' => 'Contributions',
  'weight' => '20',
  'name' => 'menu-views-collection',
));
$handler->override_option('tab_options', array(
  'type' => 'none',
  'title' => '',
  'weight' => 0,
));

The same happens if I start a view based on relationship - in this case the 'cid' in link becomes relationship id instead of corresponding contact id.

Regards,
Danila

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Discussion (deprecated) »
  • Alpha and Beta Release Testing »
  • 2.2 Release Testing »
  • Views 2 integration - incorrect link when selecting "Link this field to..."

This forum was archived on 2017-11-26.