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) »
  • Amount required for "other" contribution amount
Pages: [1]

Author Topic: Amount required for "other" contribution amount  (Read 1653 times)

coryms

  • I’m new here
  • *
  • Posts: 14
  • Karma: 0
Amount required for "other" contribution amount
June 18, 2009, 02:07:08 pm
I'm trying to create a page that will allow a visitor to either sign a petition, or sign a petition and make a donation at the same time.

To sign the petition only, it's fairly simply as I just enter one donation value as $0.00 with the description, "No, thanks I would like to sign the petition only."  That works fine as long as I do not enable an "other" donation amount in the gift array.

When I allow that, I get an error saying that the "Amount is required field" next to "Other Amount."

See the attached screenshoot to get a better idea.

Any ideas how to disable that check?

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: Amount required for "other" contribution amount
June 18, 2009, 07:00:29 pm

can you reproduce this on http://sandbox.civicrm.org/. If so, can you please file an issue and we'll fix in a future release

if important to you, please consider filing a patch along with the issue

thanx

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

coryms

  • I’m new here
  • *
  • Posts: 14
  • Karma: 0
Re: Amount required for "other" contribution amount
June 19, 2009, 06:01:03 am
Just created the contribution page here: http://sandbox.civicrm.org/civicrm/contribute/transact?reset=1&action=preview&id=4

It's "Testing Other Field Error"

You'll notice that when you select the donation amount "$0.00" you are given an error in the other field.  When the other field is not present it works.

Will open a ticket now.

Yashodha Chaku

  • Forum Godess / God
  • Ask me questions
  • *****
  • Posts: 755
  • Karma: 57
    • CiviCRM
Re: Amount required for "other" contribution amount
June 25, 2009, 04:26:44 am
coryms:

This has been fixed for 2.3. You can get the patch here
http://fisheye.civicrm.org/changelog/CiviCRM?cs=22110

hth
-Yashodha
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

coryms

  • I’m new here
  • *
  • Posts: 14
  • Karma: 0
Re: Amount required for "other" contribution amount
July 10, 2009, 03:28:53 pm
Thank you very much for the fix.  Works great!

sckwooral

  • Guest
Re: Amount required for "other" contribution amount
July 29, 2009, 02:34:56 am
this page shows up as "503" - unavailable. Can this be posted elsewhere? I could really use this patch.

Thanks.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Amount required for "other" contribution amount
July 29, 2009, 02:38:42 am
Hi,

I think that's a temporary outage rather than a problem with the link
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Yashodha Chaku

  • Forum Godess / God
  • Ask me questions
  • *****
  • Posts: 755
  • Karma: 57
    • CiviCRM
Re: Amount required for "other" contribution amount
July 29, 2009, 06:23:48 am
sckwooral :

You could use this patch :

Code: [Select]
Modified: trunk/CRM/Contribute/Form/Contribution/Main.php
===================================================================
--- trunk/CRM/Contribute/Form/Contribution/Main.php 2009-06-25 07:48:27 UTC (rev 22109)
+++ trunk/CRM/Contribute/Form/Contribution/Main.php 2009-06-25 08:15:59 UTC (rev 22110)
@@ -670,7 +670,8 @@
             if ( ( CRM_Utils_Array::value('amount',$fields) == 'amount_other_radio' )
                  || isset( $fields['amount_other'] ) ) {
 
-                if ( ! (float) $amount ) {
+                if ( ! isset($amount) &&
+                     ! CRM_Utils_Array::value('amount_level',$fields) ) {
                     $errors['amount_other'] = ts('Amount is required field.');
                 }

hth
-Yashodha
Found this reply helpful? Contribute NOW and help us improve CiviCRM with the Make it Happen! initiative.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Amount required for "other" contribution amount

This forum was archived on 2017-11-26.