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 Profiles (Moderator: Dave Greenberg) »
  • Fatal Error : Civiprofiles.php for civicrm 4.0 is different form Civicrm 3.4.
Pages: [1]

Author Topic: Fatal Error : Civiprofiles.php for civicrm 4.0 is different form Civicrm 3.4.  (Read 790 times)

mareligne

  • I post occasionally
  • **
  • Posts: 31
  • Karma: 0
  • Start with the end in mind.
  • CiviCRM version: 3.3.3
  • CMS version: Joomla 1.5.22
Fatal Error : Civiprofiles.php for civicrm 4.0 is different form Civicrm 3.4.
April 13, 2011, 08:05:27 am
I go to menu manager from my joomla install i choose new menu from the menu item type I go to
     civicrm
 Profile Create Form
 Profile Edit Form
 Profile Search Form
 Profile View Page
I select one of the above and shows this fatal error.
Select Profile
Fatal error: Call to undefined function civicrm_uf_profile_groups_get() in /home1/uniklear/public_html/unicorn/administrator/components/com_civicrm/civicrm/joomla/site/elements/civiprofiles.php on line 53

Here is the code for civiprofiles from joomla 1.6 with Civicrm 4.0 and with joomla1.5 with Civicrm 3.4

With Joomla 1.6 and Civicrm 4.0 civiprofiles.php looks like this.

// Retrieve list of CiviCRM profiles
  // Active
  // Check to ensure this file is included in Joomla!
defined('_JEXEC') or die( 'Restricted access' );

class JFormFieldCiviProfiles extends JFormField {
   /**
    * Element name
    *
    * @access   protected
    * @var      string
    */
   var   $_name = 'CiviProfiles';
   
    protected function getInput( )
   {
        $value = $this->value;
        $name  = $this->name;
       
        // Initiate CiviCRM
      require_once JPATH_ROOT.'/'.'administrator/components/com_civicrm/civicrm.settings.php';
      require_once 'CRM/Core/Config.php';
      
      $config =& CRM_Core_Config::singleton( );
      
      
        civicrm_api_include('uf_group');
        $ufGroups =civicrm_uf_profile_groups_get();
        $options[] = JHTML::_('select.option', '', JText::_('- Select Profile -') );
        foreach ( $ufGroups  as $key =>$values ) {
            $options[] = JHTML::_( 'select.option', $key, $values );
        }
        return JHTML::_( 'select.genericlist', $options, $name, null, 'value', 'text', $value );
   }
}
?>

Joomla 1.5 with civicrm 3.4 The file Civiprofile.php Looks like this .
// Retrieve list of CiviCRM profiles
  // Active
  // Check to ensure this file is included in Joomla!
defined('_JEXEC') or die( 'Restricted access' );

class JElementCiviprofiles extends JElement {
   /**
    * Element name
    *
    * @access   protected
    * @var      string
    */
   var   $_name = 'CiviProfiles';
   
   function fetchElement($name, $value, &$node, $control_name)
   {
      // Initiate CiviCRM
      require_once JPATH_ROOT.'/'.'administrator/components/com_civicrm/civicrm.settings.php';
      require_once 'CRM/Core/Config.php';
      $config =& CRM_Core_Config::singleton( );
      
      require_once 'api/v2/UFGroup.php';
        $ufGroups =civicrm_uf_profile_groups_get();
        $options[] = JHTML::_('select.option', '', JText::_('- Select Profile -') );
        foreach ( $ufGroups  as $key =>$values ) {
            $options[] = JHTML::_( 'select.option', $key, $values );
        }
        return JHTML::_( 'select.genericlist', $options, 'params[gid]', null, 'value', 'text', $value );
   }
}
?>

Is the files in civicrm 4.0 differnet from Civicrm 3.4 or there is a file difference and how could i correct the errors in this case.

sushant

  • I post frequently
  • ***
  • Posts: 126
  • Karma: 8
  • CiviCRM version: v3.2.x,v3.3.x v4.0.x, v4.x,trunk
  • CMS version: Drupal 6/7 ,joomla 1.5,1.6
  • MySQL version: 5.1.51
  • PHP version: 5.3.3
Re: Fatal Error : Civiprofiles.php for civicrm 4.0 is different form Civicrm 3.4.
April 13, 2011, 09:20:17 pm
Hi mareligne,
This issue was fixed for CiviCRM 3.4 & also for CiviCRM 4.0.
Following is the patch that will help you:
https://fisheye2.atlassian.com/changelog/CiviCRM?cs=32806

Hth
Sushant.
CiviCRM Priority Support
http://support.civigardens.com/
http://osseed.com

mareligne

  • I post occasionally
  • **
  • Posts: 31
  • Karma: 0
  • Start with the end in mind.
  • CiviCRM version: 3.3.3
  • CMS version: Joomla 1.5.22
Re: Fatal Error : Civiprofiles.php for civicrm 4.0 is different form Civicrm 3.4.
April 14, 2011, 08:31:43 pm
I go to the link and i couldn't found the 4.0 fix so i use the 3.3 and 3.4 fixes but this time the error is different
Class 'JElement' not found in /home1/uniklear/public_html/unicorn/administrator/components/com_civicrm/civicrm/joomla/site/elements/civiprofiles.php on line 31
Did i have to change more code for my 4.0 installation in joomla 1.6.
Thanks Sushant.

sushant

  • I post frequently
  • ***
  • Posts: 126
  • Karma: 8
  • CiviCRM version: v3.2.x,v3.3.x v4.0.x, v4.x,trunk
  • CMS version: Drupal 6/7 ,joomla 1.5,1.6
  • MySQL version: 5.1.51
  • PHP version: 5.3.3
Re: Fatal Error : Civiprofiles.php for civicrm 4.0 is different form Civicrm 3.4.
April 14, 2011, 09:33:05 pm
Following is the issue which includes all the fixes for CiviCRM4.0+joomla1.6
http://issues.civicrm.org/jira/browse/CRM-7134

Latest version of CiviCRM 4.0 includes all the fixes.

Hth
Sushant
CiviCRM Priority Support
http://support.civigardens.com/
http://osseed.com

mareligne

  • I post occasionally
  • **
  • Posts: 31
  • Karma: 0
  • Start with the end in mind.
  • CiviCRM version: 3.3.3
  • CMS version: Joomla 1.5.22
Re: Fatal Error : Civiprofiles.php for civicrm 4.0 is different form Civicrm 3.4.
April 15, 2011, 08:28:15 am
Thanks sushant .

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • Fatal Error : Civiprofiles.php for civicrm 4.0 is different form Civicrm 3.4.

This forum was archived on 2017-11-26.