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 CiviContribute (Moderator: Donald Lobo) »
  • Fatal error: Call to a member function doDirectPayment() on a non-object in
Pages: [1]

Author Topic: Fatal error: Call to a member function doDirectPayment() on a non-object in  (Read 3084 times)

speleo

  • Ask me questions
  • ****
  • Posts: 396
  • Karma: 28
  • CiviCRM version: 4.3.1
  • CMS version: J! 2.5,9
  • MySQL version: 5.1
  • PHP version: 5.3.24
Fatal error: Call to a member function doDirectPayment() on a non-object in
September 12, 2012, 09:31:14 am
upgraded from v4.1.2 to v4.2 (Joomla 2.5.5).

All contribution pages are now seeing when clicking "make contribution" using PayPal standard

Code: [Select]
Fatal error: Call to a member function doDirectPayment() on a non-object in /home/name/public_html/administrator/components/com_civicrm/civicrm/CRM/Contribute/BAO/Contribution/Utils.php on line 210

The PayPalImp.php file changed at the end

Code: [Select]
        /* Success */
        $params['trxn_id']        = $result['transactionid'];
        $params['gross_amount'  ] = $result['amt'];       
        return $params;

to:

Code: [Select]
    /* Success */

    $params['trxn_id'] = CRM_Utils_Array::value('transactionid', $result);
    $params['gross_amount'] = CRM_Utils_Array::value('amt', $result);
    return $params;

Any ideas????
« Last Edit: September 12, 2012, 09:34:01 am by speleo »

speleo

  • Ask me questions
  • ****
  • Posts: 396
  • Karma: 28
  • CiviCRM version: 4.3.1
  • CMS version: J! 2.5,9
  • MySQL version: 5.1
  • PHP version: 5.3.24
Re: Fatal error: Call to a member function doDirectPayment() on a non-object in
September 12, 2012, 02:59:36 pm
Upgraded to 4.2.1 to see if it makes any difference.  No change.

line 210 of administrator/components/com_civicrm/civicrm/CRM/Contribute/BAO/Contribution/Utils.php is

$result = &$payment->doDirectPayment($paymentParams)

I can see what $paymentParams contains but am not sure what I'm looking for.  Any help most welcome!!!
 

mudmin

  • I post occasionally
  • **
  • Posts: 51
  • Karma: 1
  • CiviCRM version: 4.2.0
  • CMS version: Joomla 2.5.6
  • MySQL version: 5
  • PHP version: not sure
Re: Fatal error: Call to a member function doDirectPayment() on a non-object in
September 13, 2012, 03:59:31 pm
These are the kind of questions that every time I post, no one seems to answer.

speleo

  • Ask me questions
  • ****
  • Posts: 396
  • Karma: 28
  • CiviCRM version: 4.3.1
  • CMS version: J! 2.5,9
  • MySQL version: 5.1
  • PHP version: 5.3.24
Re: Fatal error: Call to a member function doDirectPayment() on a non-object in
September 13, 2012, 11:37:43 pm
right there with you mudmin!

I've checked that this is nothing to do with anything in my custom directories so it looks like I need to dig in the core. 

Does anyone have a suggestion as to where to look? 

mudmin

  • I post occasionally
  • **
  • Posts: 51
  • Karma: 1
  • CiviCRM version: 4.2.0
  • CMS version: Joomla 2.5.6
  • MySQL version: 5
  • PHP version: not sure
Re: Fatal error: Call to a member function doDirectPayment() on a non-object in
September 14, 2012, 04:23:35 am
Have you upgraded to 4.2.1?  There were some paypal bugs in 4.2

speleo

  • Ask me questions
  • ****
  • Posts: 396
  • Karma: 28
  • CiviCRM version: 4.3.1
  • CMS version: J! 2.5,9
  • MySQL version: 5.1
  • PHP version: 5.3.24
Re: Fatal error: Call to a member function doDirectPayment() on a non-object in
September 14, 2012, 10:34:22 am
I'm on 4.2.1. Problem still there....

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: Fatal error: Call to a member function doDirectPayment() on a non-object in
September 14, 2012, 10:38:25 am

can u reproduce this on our demo servers? would help us isolate and fix the issue

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

speleo

  • Ask me questions
  • ****
  • Posts: 396
  • Karma: 28
  • CiviCRM version: 4.3.1
  • CMS version: J! 2.5,9
  • MySQL version: 5.1
  • PHP version: 5.3.24
Fixed: Fatal error: Call to a member function doDirectPayment() on a non-object
September 17, 2012, 11:30:45 pm
Problem is due to JS conflicts with Shape5 vertex templates.

http://forum.civicrm.org/index.php/topic,25834.0.html
http://forum.civicrm.org/index.php/topic,26055.msg110204.html#msg110204

I've not found the offending code but a quick workaround was to simply use the default joomla 2.5 template for all contribution pages.

This affects both Shape5 vertex v1 and v2 templates by the look of it.  I also tried a js conflict and aggregation tool but no joy.

Thanks all for support and direction

drupleg

  • I post occasionally
  • **
  • Posts: 39
  • Karma: 2
    • Drupal.org Profile
  • CiviCRM version: 4.1
  • CMS version: Drupal 7
  • PHP version: 5.3
Re: Fatal error: Call to a member function doDirectPayment() on a non-object in
September 18, 2012, 09:47:02 am
Hello, I had this problem a few days ago.  However I am using Drupal 7 w/CiviCRM 4.2.0 (at the time). Also not limited to PayPal as we've been using eProcessingNetwork w/authorize.net emulation. I've since upgraded to 4.2.1 today.  I've processed several test transactions without the error.  However, I have one particular user who was getting this error when he tried to renew last week. 

My question at this point is - how can I process this and try to renew as that user? This user has been good enough to try and renew 3 times already and keeps getting the error.  Is there a way, now that this may have been fixed in 4.2.1, that I can try to renew the form and masquerade as that user for testing purposes?

Thank you,
--Tony

speleo

  • Ask me questions
  • ****
  • Posts: 396
  • Karma: 28
  • CiviCRM version: 4.3.1
  • CMS version: J! 2.5,9
  • MySQL version: 5.1
  • PHP version: 5.3.24
Re: Fatal error: Call to a member function doDirectPayment() on a non-object in
September 18, 2012, 10:37:32 am
Tony,  I'm not sure where to start with Drupal (since I'm a Joomla user).  However I would look at what js is going on under the hood and see if you can narrow it down to a particular function.

drupleg

  • I post occasionally
  • **
  • Posts: 39
  • Karma: 2
    • Drupal.org Profile
  • CiviCRM version: 4.1
  • CMS version: Drupal 7
  • PHP version: 5.3
Re: Fatal error: Call to a member function doDirectPayment() on a non-object in
September 18, 2012, 11:56:45 am
No worries, the member in question went ahead and renewed their membership today and everything was processed properly, no errors, all is well.  Looks like for me w/Drupal, CiviCRM 4.2.1 has resolved this issue. 

The only other mention I can make is that I'm still using the default CiviCRM templates. I disabled all of my custom templates when we first had this issue a few weeks ago, and I've not bothered to turn them back on for fear the problem will crop-up again.

Thanks!
--Tony

jakecivi

  • I post frequently
  • ***
  • Posts: 140
  • Karma: 0
Re: Fatal error: Call to a member function doDirectPayment() on a non-object in
October 01, 2012, 03:40:01 pm
Same problem, Drupal 6, CiviCRM 4.2.2.  Help!!!

Edit: It's actually a slightly different problem: mine is in CRM/Event/Form/Registration/Confirm.php on line 588.
« Last Edit: October 01, 2012, 03:55:54 pm by jakecivi »

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: Fatal error: Call to a member function doDirectPayment() on a non-object in
October 01, 2012, 06:39:13 pm

try the patch here

http://issues.civicrm.org/jira/browse/CRM-10942

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

jakecivi

  • I post frequently
  • ***
  • Posts: 140
  • Karma: 0
Re: Fatal error: Call to a member function doDirectPayment() on a non-object in
October 01, 2012, 06:46:24 pm
I'll see if it helps; actually I doubt it because the problem comes I think from trying to use PayPal on an event registration for which I've changed the fee values using buildAmount.  But I'll let you know...

Update:  Nope, I'm still getting the error in CRM/Event/Form/Registration/Confirm.php on line 588.

Another update: I turned my module off.  It's still totally broken for one event (the for whose registrations my module was doing buildAmount - but that shouldn't matter anymore because I disabled my module, right?), but works for another event with just about the same settings!
« Last Edit: October 01, 2012, 07:08:33 pm by jakecivi »

jakecivi

  • I post frequently
  • ***
  • Posts: 140
  • Karma: 0
Re: Fatal error: Call to a member function doDirectPayment() on a non-object in
October 02, 2012, 03:14:54 pm
Another totally bizarre thing:  I made one new event, which worked both before and after I enabled my module to do anything with it, and then I made another event, which did not work before OR after.

Another symptom of the problem is that, if send payment later is enabled and I choose PayPal payment processor, on the Confirmation screen, it still shows the instructions for paying by check, and then it just goes through all the way as though it were a pay later registration.  Or - this is a new one - on the latest try it gave this error in the log (and on screen):

Code: [Select]
Oct 02 18:11:34  [info] $Fatal Error Details = Array
(
    [message] => Could not find valid value for id
    [code] =>
)


Oct 02 18:16:00  [info] $backTrace = #0 [...]/sites/all/modules/civicrm/CRM/Core/Error.php(300): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 [...]/sites/all/modules/civicrm/CRM/Utils/Request.php(106): CRM_Core_Error::fatal("Could not find valid value for id")
#2 [...]/sites/all/modules/civicrm/CRM/Event/StateMachine/Registration.php(52): CRM_Utils_Request::retrieve("id", "Positive", Object(CRM_Event_Controller_Registration), TRUE)
#3 [...]/sites/all/modules/civicrm/CRM/Event/Controller/Registration.php(43): CRM_Event_StateMachine_Registration->__construct(Object(CRM_Event_Controller_Registration), TRUE)
#4 [...]/sites/all/modules/civicrm/CRM/Core/Invoke.php(223) : eval()'d code(1): CRM_Event_Controller_Registration->__construct("Event Registration", TRUE, "null", NULL, "false")
#5 [...]/sites/all/modules/civicrm/CRM/Core/Invoke.php(223): eval()
#6 [...]/sites/all/modules/civicrm/drupal/civicrm.module(382): CRM_Core_Invoke::invoke((Array:3))
#7 [internal function](): civicrm_invoke("event", "register")
#8 [...]/includes/menu.inc(350): call_user_func_array("civicrm_invoke", (Array:2))
#9 [...]/index.php(17): menu_execute_active_handler()
#10 {main}


Disabling pay later completely and then registering yields the error message in the previous post.
« Last Edit: October 02, 2012, 03:18:21 pm by jakecivi »

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Fatal error: Call to a member function doDirectPayment() on a non-object in

This forum was archived on 2017-11-26.