lcdservices / biz.lcdservices.movecontrib

CiviCRM extension to support moving a contribution from one contact to another.
Other
4 stars 8 forks source link

Stopped working on 5.35 #7

Closed larssandergreen closed 2 years ago

larssandergreen commented 3 years ago

This extension has been working great for us for a while, thanks!

Not sure if it is still being maintained, but it seems to have stopped working once we upgraded to 5.35.1. Trying to move a contribution results in errors and a $0 contribution being recorded on the contact you are trying to move to (the original contribution seems to be untouched). This $0 contribution can't be edited or deleted normally.

Here's what I see in our logs:

[error] $Fatal Error Details = array:3 [ "message" => "One of parameters (value: ) is not of the type Integer" "code" => null "exception" => CRM_Core_Exception {#2320 -errorData: array:1 [ "error_code" => 0 ]

cause: null

-_trace: null
#message: "One of parameters  (value: ) is not of the type Integer"
#code: 0
#file: "/var/www/html/sites/all/modules/civicrm/CRM/Utils/Type.php"
#line: 470
trace: {
  /var/www/html/sites/all/modules/civicrm/CRM/Utils/Type.php:470 {
    ›   $data = htmlentities($data);
    ›   throw new CRM_Core_Exception("$name (value: $data) is not of the type $type");
    › }
  }
  /var/www/html/sites/all/modules/civicrm/CRM/Core/DAO.php:1665 { …}
  /var/www/html/sites/all/modules/civicrm/CRM/Core/DAO.php:1547 { …}
  /var/www/html/sites/all/modules/civicrm/CRM/Core/BAO/FinancialTrxn.php:91 { …}
  /var/www/html/sites/all/modules/civicrm/CRM/Contribute/BAO/Contribution.php:3951 { …}
  /var/www/html/sites/all/modules/civicrm/CRM/Contribute/Form/AbstractEditPayment.php:714 { …}
  /var/www/html/sites/all/modules/civicrm/CRM/Contribute/Form/Contribution.php:234 { …}
  /var/www/html/sites/all/modules/civicrm/CRM/Core/Form.php:608 { …}
  /var/www/html/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Display.php:76 { …}
  /var/www/html/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php:203 { …}
  /var/www/html/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php:103 { …}
  /var/www/html/sites/all/modules/civicrm/CRM/Core/Controller.php:347 { …}
  /var/www/html/sites/all/modules/civicrm/CRM/Contribute/Page/Tab.php:312 { …}
  /var/www/html/sites/all/modules/civicrm/CRM/Contribute/Page/Tab.php:368 { …}
  /var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php:312 { …}
  /var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php:68 { …}
  /var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php:36 { …}
  /var/www/html/sites/all/modules/civicrm/drupal/civicrm.module:458 { …}
  /var/www/html/includes/menu.inc:527 { …}
  /var/www/html/index.php:21 { …}
}

} ]

[debug] $backTrace = #0 /var/www/html/sites/all/modules/civicrm/CRM/Core/Error.php(433): CRM_Core_Error::backtrace("backTrace", TRUE)

1 /var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php(39): CRM_Core_Error::handleUnhandledException(Object(CRM_Core_Exception))

2 /var/www/html/sites/all/modules/civicrm/drupal/civicrm.module(458): CRM_Core_Invoke::invoke((Array:4))

3 /var/www/html/includes/menu.inc(527): civicrm_invoke("contact", "view", "contribution")

4 /var/www/html/index.php(21): menu_execute_active_handler()

5 {main}

magnolia61 commented 3 years ago

Not sure if this is related but using CiviCRM 5.43 I get the following:

+userinfo: "INSERT INTO `civicrm_contribution` (`contact_id` , `payment_instrument_id` , `receive_date` , `fee_amount` , `net_amount` , `invoice_number` , `currency` , `contribution_status_id` ) VALUES ( 17998 ,  4 ,  20211112131948 ,  0 ,  0 , 'Factuur_kamp_9705' , 'EUR' ,  1 )  [nativecode=1364 ** Field 'total_amount' doesn't have a default value]"
      +backtrace: array:26 [

Field 'total_amount' doesn't have a default value]"

lcdservices commented 3 years ago

@magnolia61 -- I haven't been able to reproduce this issue, and I believe the original issue from this ticket is resolved. But I just pushed up a small patch. Can you upgrade to v2.3 and test again? If the error persists, can you provide the full backtrace, and also observe if there's anything unusual about this particular contribution?

magnolia61 commented 2 years ago

@lcdservices Didnot feedback you since, but your patch solved the issue. Thanks Brian.