Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5.47RC fatal error: "setAmount requires a numeric amount value" #220

Closed
magnolia61 opened this issue Feb 8, 2022 · 11 comments
Closed

5.47RC fatal error: "setAmount requires a numeric amount value" #220

magnolia61 opened this issue Feb 8, 2022 · 11 comments

Comments

@magnolia61
Copy link
Contributor

magnolia61 commented Feb 8, 2022

Hello Eileen,
While trying 5.47RC paying a contribution fee resulted in the following error.
Reverting to 5.46 stable made this error disappear.

Would this signal a problem in core (RC) or something in this extension?

Regards,
Richard

` [error]
$Fatal Error Details = array:3 [
"message" => "setAmount requires a numeric amount value"
"code" => null
"exception" => InvalidArgumentException {#4241
#message: "setAmount requires a numeric amount value"
#code: 0
#file: "/var/www/vhosts/xyz/webroot/sites/all/modules/civicrm/Civi/Payment/PropertyBag.php"
#line: 467
trace: {
/var/www/vhosts/xyz/webroot/sites/all/modules/civicrm/Civi/Payment/PropertyBag.php:467 {
› if (!is_numeric($value)) {
› throw new \InvalidArgumentException("setAmount requires a numeric amount value");
› }
}
/var/www/vhosts/xyz/webroot/sites/all/modules/civicrm/Civi/Payment/PropertyBag.php:242 { …}
/var/www/vhosts/xyz/webroot/sites/all/modules/civicrm/Civi/Payment/PropertyBag.php:367 { …}
/var/www/vhosts/xyz/webroot/sites/all/modules/civicrm_extensions/nz.co.fuzion.omnipaymultiprocessor/CRM/Core/Payment/OmnipayMultiProcessor.php:247 { …}
/var/www/vhosts/xyz/webroot/sites/all/modules/civicrm_extensions/nz.co.fuzion.omnipaymultiprocessor/CRM/Core/Payment/OmnipayMultiProcessor.php:152 { …}
/var/www/vhosts/xyz/webroot/sites/all/modules/civicrm/CRM/Contribute/Form/Contribution/Confirm.php:2754 { …}
/var/www/vhosts/xyz/webroot/sites/all/modules/civicrm/CRM/Contribute/Form/Contribution/Confirm.php:2361 { …}
/var/www/vhosts/xyz/webroot/sites/all/modules/civicrm/CRM/Contribute/Form/Contribution/Confirm.php:855 { …}
/var/www/vhosts/xyz/webroot/sites/all/modules/civicrm/CRM/Core/Form.php:573 { …}
/var/www/vhosts/xyz/webroot/sites/all/modules/civicrm/CRM/Contribute/Form/Contribution/Main.php:1489 { …}
/var/www/vhosts/xyz/webroot/sites/all/modules/civicrm/CRM/Contribute/Form/Contribution/Main.php:1231 { …}
/var/www/vhosts/xyz/webroot/sites/all/modules/civicrm/CRM/Core/Form.php:573 { …}
/var/www/vhosts/xyz/webroot/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Upload.php:152 { …}
/var/www/vhosts/xyz/webroot/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Upload.php:119 { …}
/var/www/vhosts/xyz/webroot/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php:203 { …}
/var/www/vhosts/xyz/webroot/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php:103 { …}
/var/www/vhosts/xyz/webroot/sites/all/modules/civicrm/CRM/Core/Controller.php:355 { …}
/var/www/vhosts/xyz/webroot/sites/all/modules/civicrm/CRM/Core/Invoke.php:319 { …}
/var/www/vhosts/xyz/webroot/sites/all/modules/civicrm/CRM/Core/Invoke.php:69 { …}
/var/www/vhosts/xyz/webroot/sites/all/modules/civicrm/CRM/Core/Invoke.php:36 { …}
/var/www/vhosts/xyz/webroot/sites/all/modules/civicrm/drupal/civicrm.module:471 { …}
/var/www/vhosts/xyz/webroot/includes/menu.inc:527 { …}
/var/www/vhosts/xyz/webroot/index.php:21 { …}
}
}
]

To be complete the setup in which the error occurs:

  • CiviCRM: 5.47.beta1
  • CMS: Drupal 7.87
  • PHP: 7.4.27 (fpm-fcgi)
  • Database: 10.6.5-MariaDB-1:10.6.5+maria~bullseye-log engine: InnoDB 10 row format: Dynamic
  • Webserver: Apache
  • OS: Linux
    `
@eileenmcnaughton
Copy link
Owner

@magnolia61 can you tests against 5.47 now I've removed usage of the propertyBag from this extension - if there is still an issue it is in 'core core' - otherwise it was in the property bag (that was my first assumption but now I'm wondering if the issue was that amount is in the wrong format)

@magnolia61
Copy link
Contributor Author

Sure I will test

@magnolia61
Copy link
Contributor Author

I can confirm that 5.47 beta 1 (RC) works fine with omnipaymultiprocessor 3.14 with the above patch!

@eileenmcnaughton
Copy link
Owner

@magnolia61 I've just done a composer update - to bring in some other changes - if you get a chance to check no further issues with that update I'll tag a release

@magnolia61
Copy link
Contributor Author

I can confirm that current master works well with 5.47 beta 1 (RC) !

@eileenmcnaughton
Copy link
Owner

OK - I've tagged a release so will close - thanks @magnolia61 - I seem to be having some issue with the release publishing but I think that is the release system

@magnolia61
Copy link
Contributor Author

magnolia61 commented Apr 22, 2022

hmm. Not sure what happened in the meantime. But using CiviCRM 5.48 and omnipay extension 3.16 I have the same error again and cannot use the online payment method.

unknown processor error omnipay_Mollie Array ( [0] => setAmount requires a numeric amount value )

To specify: I do not get the error when people register and pay for an event.
But when they want to pay through the user dashboard or direct contribution link:
https://www.example.nl/civicrm/contribute/transact?reset=1&id=7&ccid=123&cid=456&cs=9982c0a392534059a7ae6b4f970f394c_1650623762_5648

So it seams Molly is working perfectly with us through the event registration route. It is through the contribution link route that it complains about the setAmount not set fault.

Tested some more: civicrm 5.46.3 works fine. From 5.47.0 it gives the error. It seams my earlier testing was not thorough enough.

  • CiviCRM: 5.48.2
  • CMS: Drupal 7.89
  • PHP: 7.4.28 (fpm-fcgi)
  • Database: 10.5.15-MariaDB-0+deb11u1 engine: InnoDB 10 row format: Dynamic
  • Webserver: Apache/2.4.53 (Debian)
  • OS: Linux

@magnolia61
Copy link
Contributor Author

magnolia61 commented Apr 22, 2022

I think I found the change in core that causes this:

It is in Civi/Payment/PropertyBag.php

protected static $propMap = [
    'amount'                      => TRUE,
    'total_amount'                => 'amount',

In 5.47 the ' total amount' was added here. If I remove that single line all works fine again. But that is probably not the preferable solution...

@eileenmcnaughton
Copy link
Owner

@magnolia61 are you sure you actually have the latest code - because I stopped using the PropertyBag here

1d6e31e

@magnolia61
Copy link
Contributor Author

magnolia61 commented Apr 22, 2022

Yep, very sure.. Deleted manually and redownloaded 3.16.
the total_amount thing in PropertyBag seems to mess up things anyway,

image

@magnolia61
Copy link
Contributor Author

We dis some more research and found it is not omnipay related. Cause seems to be specific decimal separator settings that do not work anymore since civicrm/civicrm-core#21583

I opened up an issue: https://lab.civicrm.org/dev/core/-/issues/3413

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants