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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Found a few incorrect function calls in 4.1.2
Pages: [1]

Author Topic: Found a few incorrect function calls in 4.1.2  (Read 844 times)

dennis

  • I’m new here
  • *
  • Posts: 5
  • Karma: 0
  • CiviCRM version: 4.1.2
  • CMS version: Drupal
  • MySQL version: 5.5.9
  • PHP version: 5.3.6
Found a few incorrect function calls in 4.1.2
June 14, 2012, 10:51:46 pm
In the process of debugging, I found that civicrm_api3_create_success() is not always called with the correct parameters.  I had PHP warnings/notices enabled and was getting errors due to the passed parameters not being of the correct type.  The function is defined as:

function civicrm_api3_create_success($values = 1, $params = array(), $entity = NULL, $action = NULL, &$dao = NULL)

and it is called (for example in _civicrm_api3_basic_create() as:

civicrm_api3_create_success($values, $params, $bao, 'create')

Notice that the $entity parameter is passed $bao.  The function expects a string and instead receives a complex object.  We bumped into this a couple times, so I did a search of the code and found what looks like problems in the following files:

sites/all/modules/civicrm/api/v3/utils.php
sites/all/modules/civicrm/api/v3/Address.php
sites/all/modules/civicrm/api/v3/CustomField.php
sites/all/modules/civicrm/api/v3/CustomGroup.php
sites/all/modules/civicrm/api/v3/Phone.php
sites/all/modules/civicrm/api/v3/Website.php

I don't know what this function does or whether the problem really matters; it can impede debugging, at least! :) 

Another issue I tripped across is that in two places it looks like the code tries to call loadBootStrap(), but calls loadBootstrap(), instead (notice the lower-case 's').  I discovered this in:

sites/all/modules/civicrm/bin/cli.php
sites/all/modules/civicrm/CRM/Utils/System/WordPress.php

Not being familiar with this code or with how to test it, I wanted to bring it to the attention of someone more knowledgeable.  I checked and the problems seem to still exist in 4.1.3.  Thanks,

Dennis

wolfreiner

  • I’m new here
  • *
  • Posts: 2
  • Karma: 0
  • CiviCRM version: 4.1
  • CMS version: Wordpress 3.4.0
  • MySQL version: 5.0.51a-24+lenny5
  • PHP version: 5.2.6-1+lenny13
Re: Found a few incorrect function calls in 4.1.2
July 03, 2012, 09:34:42 am
I got stuck at one of the same modules. Wenn I call "Custom Fields" on the Administration Menu, I get following errormessage: Parse error: syntax error, unexpected '<' in /var/www/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/CustomGroup.php(2015) : eval()'d code on line 1

Sorry, an unrecoverable error occured.
Arg is not of type array

Has anyone a clue, how to fix this problem?

Thanx in advance Wolf

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: Found a few incorrect function calls in 4.1.2
July 05, 2012, 10:06:50 am

if i had to guess the file:

/var/www/wordpress/wp-content/plugins/civicrm/civicrm/CRM/Core/BAO/CustomGroup.php

has not been transferred properly

might want to check that file and others

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Found a few incorrect function calls in 4.1.2

This forum was archived on 2017-11-26.