CiviCRM Community > Developer Discussion

Found a few incorrect function calls in 4.1.2

(1/1)

dennis:
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 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:

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

Navigation

[0] Message Index

Go to full version