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 Drupal Modules (Moderator: Donald Lobo) »
  • drupal views custom data after upgrade to 4.1
Pages: [1]

Author Topic: drupal views custom data after upgrade to 4.1  (Read 950 times)

Jeroen~

  • I’m new here
  • *
  • Posts: 25
  • Karma: 1
    • WoesteLand
  • CiviCRM version: CiviCRM 4.2
  • CMS version: Drupal 7
drupal views custom data after upgrade to 4.1
February 17, 2012, 11:23:52 am
I upgraded my site to civi 4.1 today.
Everything works fine except the following:
I have a view witch displays events with custom data.
In previous versions (including the 4.1 beta's) the custom data label was displayed, now instead of the label, the custom value is displayed.
Does any bothy recognise this problem? And can anybody tell me how to fix this?

bouton

  • Guest
Re: drupal views custom data after upgrade to 4.1
March 22, 2012, 05:44:07 am
Have you had any luck with this? I have had the same problem and the only way I have been able to fix it is to do a views file template for each custom data filed that is not displaying properly
eg I have a custom field called activities
I create a views termplate views-view-field--page--activities-8.tpl.php in which I have written
Code: [Select]
<?php 
civicrm_initialize
();
$sp = CRM_Core_DAO::VALUE_SEPARATOR;
$values = $output;
$labels = array();
if (
strpos($values, $sp) !== FALSE) {
       
$values = explode($sp, trim($values, $sp));
}
if(isset(
$values) && $values !="") {
foreach ($values as $index => $value) {
$results=civicrm_api("OptionValue","get", array ('version' =>'3', 'value' =>$value));
$labels[] = $results['values'][$results['id']]['label'];
}
print  implode(", ", $labels);
}
?>


Seem ridiculous to have to do this - but it works as I can't find the mistake in the custom handler. Anyone who has I'd love a hint.

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: drupal views custom data after upgrade to 4.1
May 02, 2012, 05:40:42 pm
Try the patch I've posted at http://issues.civicrm.org/jira/browse/CRM-10163 ? That appears to fix the issue.

CiviCRM's custom field handler wasn't being called at all (prob why @bouton couldn't find the mistake in it!), so the default views handler was representing the raw data instead.

Would be nice to add more display options for custom fields but will leave that for now.
@xurizaemon ā— www.fuzion.co.nz

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: drupal views custom data after upgrade to 4.1
May 02, 2012, 06:45:57 pm
Lobo has updated that ticket - similar patch applied from CRM-9811

http://issues.civicrm.org/jira/secure/attachment/15402/civicrm.views.inc.patch
@xurizaemon ā— www.fuzion.co.nz

bouton

  • Guest
Re: drupal views custom data after upgrade to 4.1
May 30, 2012, 07:55:20 am
patch works for me - thanks

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • drupal views custom data after upgrade to 4.1

This forum was archived on 2017-11-26.