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) »
  • Negative donations are being accepted
Pages: [1]

Author Topic: Negative donations are being accepted  (Read 2307 times)

wmostrey

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 3
    • Wim Mostrey
Negative donations are being accepted
November 23, 2007, 12:47:23 am
When I enter "-10" as a donation amount, this number is being accepted and I am taken to the next step without any kind of warning. Is this intentional or is this a bug? I search through the documentation and fora but couldn't find anything referring to this issue.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Negative donations are being accepted
November 23, 2007, 10:50:48 am
You should be able to prevent this by entering a value for "Minimum Amount" in the Allow Other Amounts section of Configure Online Contribution page - Contribution Amounts screen? However, in playing with this I discovered that you need to enter an amount > 0.00 as your minimum in order for this to be enforced. This is a bug which we'll fix in 2.0 - in the meantime entering .01 or some other non-zero amount should solve this for you.
Protect your investment in CiviCRM by  becoming a Member!

wmostrey

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 3
    • Wim Mostrey
Re: Negative donations are being accepted
November 23, 2007, 12:18:39 pm
It doesn't seem to take the minimum amount into account. Even when I put £10 as the minimum amount, and I enter £1 as the donation value, it accepts it. The configured maximum amount is also ignored: I put £100 as the maximum but I can still donate £200 without any errors.

Related to this: If I enter a numeric value on the donation form, the next page contains a title:
Contribution Amount
Total Amount: £ 1.00

Entering a negative value (this should never be accepted as a valid donation amount) I am successfully redirected to the following page, which doesn't have said title. So at some level the script understands that an errorous amount has been entered, but no error is given and the next stage of the donation process is presented.
« Last Edit: November 23, 2007, 12:20:15 pm by wmostrey »

wmostrey

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 3
    • Wim Mostrey
Re: Negative donations are being accepted
November 26, 2007, 04:24:13 am
Could anyone confirm this is normal behavior? We're using version CiviCRM 1.7 and it seems really odd that min/max amounts are absolutely ignored. Is there some quick fix for this?

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Negative donations are being accepted
November 26, 2007, 06:48:30 am
The minimum and maximum amounts should be enforced. We are currently aware of a bug when a minimum of 0 is used. If you are seeing problems beyond this - please replicate the problem on our demo site (version 1.9) and report the steps to replicate as an issue on our bug tracker. Thx!
Protect your investment in CiviCRM by  becoming a Member!

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: Negative donations are being accepted
November 26, 2007, 08:29:08 am

You can also follow and track the issue in 2.0 here: http://issues.civicrm.org/jira/browse/CRM-2442?page=com.atlassian.jira.ext.fisheye:fisheye-issuepanel

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

wmostrey

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 3
    • Wim Mostrey
Re: Negative donations are being accepted
November 27, 2007, 01:59:08 am
It's hard to replicate this on the 1.9 demo site. I have everything set up but when I submit the form on http://demo.civicrm.org/drupal/civicrm/contribute/transact?reset=1&id=8 I get the following error:

Code: [Select]
Fatal error: Call to undefined method CRM_Utils_System::ipaddress() in /var/www/demo.civicrm.org/svn/stable/CRM/Contribute/Form/Contribution/Confirm.php on line 120
I've done some debugging (we're running version 1.8 btw, not 1.7)  and it appears that in CRM/Contribute/Form/Contribution/Main.php rule nr 416 the following statement is false:

Code: [Select]
if ( CRM_Utils_Array::value('amount',$fields) == 'amount_other_radio' ) {
Because it is false, the min/max check never happens. I tried this on two instances of v1.8 now and the same thing occured. I fixed this myself now, so that's OK.

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: Negative donations are being accepted
November 27, 2007, 05:39:49 am

the demo is now fixed.

there was a bad commit which resulted in the ipAddress fatal error message

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

wmostrey

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 3
    • Wim Mostrey
Re: Negative donations are being accepted
November 28, 2007, 07:40:34 am
Thanks for fixing it. The bug is easily reproduced:

http://demo.civicrm.org/drupal/civicrm/admin/contribute?reset=1&action=update&id=8&subPage=Amount

Min amount: 100
Max amount: 200

I can enter "5", "210" or "-100" and all values will be accepted on the form:

http://demo.civicrm.org/drupal/civicrm/contribute/transact?reset=1&id=8

I created an issue for this on JIRA: http://issues.civicrm.org/jira/browse/CRM-2460

wmostrey

  • I post occasionally
  • **
  • Posts: 36
  • Karma: 3
    • Wim Mostrey
Re: Negative donations are being accepted
November 29, 2007, 02:36:51 am
As a reply on http://issues.civicrm.org/jira/browse/CRM-2460 this happens each time when no static amounts are entered and thus there is no radio box to check "Other amount" on. In that case
Code: [Select]
if ( CRM_Utils_Array::value('amount',$fields) == 'amount_other_radio' ) { is always FALSE and the min/max setting is not checked.

I have no way to re-open the ticket so to be sure I left a comment and post this reply.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Negative donations are being accepted

This forum was archived on 2017-11-26.