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 CiviMember (Moderator: Deepak Srivastava) »
  • Profiles in Drupal Using api/UFGroup.php
Pages: [1]

Author Topic: Profiles in Drupal Using api/UFGroup.php  (Read 1660 times)

kurosevic

  • I’m new here
  • *
  • Posts: 25
  • Karma: 1
Profiles in Drupal Using api/UFGroup.php
December 22, 2010, 08:22:58 am
I'm trying to include civicrm information in our Drupal profiles.

This was working just fine until I upgraded to 3.3.1. There is an error that is given to me now when the drupal user-profile.php is run:
Quote
Fatal error: require_once() [function.require]: Failed opening required 'api/UFGroup.php' (include_path='.:/home/octla/public_html/sites/all/modules/civicrm:/home/octla/public_html/sites/all/modules/civicrm/packages:.:/usr/lib/php:/usr/local/lib/php') in /home/octla/public_html/themes/octla/user-profile.tpl.php on line 8
The user-profile.php file contains this code (only the first part of it, the omitted part is the actual outputted fields in xhtml:
Code: [Select]
if (module_exists('civicrm')) {

     //initialize civicrm
     civicrm_initialize(TRUE);

     //required to use crm_uf_get_match_id function
     require_once 'api/UFGroup.php';

     //get user id from CIVICRM, using the $uid from the contact you're looking at
     $userID = crm_uf_get_match_id( $account->uid );
    
     // We will find the values from this contact using it's userID
     $retrieve = array( contact_id => $userID  );

     //required to use civicrm_contact_get function
     require_once 'api/v2/Contact.php';
     $civiUser = civicrm_contact_get( $retrieve );
    
    
    //variables set
    $updateNeeded = false;
    $username = $user->name;
    $Demail = $user->mail;
    $Cemail = $civiUser[$userID]['email'];
    $membertype = $user->roles;
    $avatar = $account->content['user_picture']['#value'];
    $firstname = $civiUser[$userID]['first_name'];
    $lastname = $civiUser[$userID]['last_name'];
    $street = $civiUser[$userID]['street_address'];
    $city = $civiUser[$userID]['city'];
    $zip = $civiUser[$userID]['postal_code'];
    $state = $civiUser[$userID]['state_province'];
    $employer = $civiUser[$userID]['current_employer'];

Has something changed in the most current version that is preventing this from working like it has?
« Last Edit: December 22, 2010, 08:26:09 am by kurosevic »

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: Profiles in Drupal Using api/UFGroup.php
December 22, 2010, 07:51:51 pm

all the api functions were moved over to api/v2 and the names were standardized

there were a few stragglers which we resolved in the 3.3 release and hence the error. We intend to do a better job logging such changes in future releases


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

geoffbfc

  • I’m new here
  • *
  • Posts: 13
  • Karma: 0
  • CiviCRM version: 3.3
  • CMS version: Drupal 6.2
  • MySQL version: na
  • PHP version: NA
Re: Profiles in Drupal Using api/UFGroup.php
April 11, 2011, 06:10:23 am

Am I missing something (very new to Civi- but it looks great)

What is the fix for this?


Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMember (Moderator: Deepak Srivastava) »
  • Profiles in Drupal Using api/UFGroup.php

This forum was archived on 2017-11-26.