Givewp: fix(admin-form): ensure form always publishes in usable state

Created on 15 May 2017  路  7Comments  路  Source: impress-org/givewp

Issue Overview

I think every form that publishes should be able to accept donations in one form or another. While I admit this scenario would be highly unlikely we should be able to do something to avoid it from happening.

Current Behavior

If you set a form to "Set Donation", set the amount to 0 and set Custom Amount to "Disabled" then the form is useless.

image

Possible Solution

  1. Add validation in the Form Edit screen to prevent saving the form if this combo is selected.
  2. Prevent 0 from being inserted into the "Set Amount" field at all. Maybe on blur it reverts to 1.00 and
    a tooltip appears saying "Setting this to 0 effectively disables the form. Please select at least $1 or more for this option".

Most helpful comment

@kevinwhoffman @mathetos

Testing Summary

I have tested this issues with Give Core 2.0.7

  • [x] Tested by creating a new donation form where the Donation Option is set as Multi-level Donation

  • [x] Tested by creating a new donation form where the Donation Option is set as Set Donation and Custom Amount option is Disable

  • [x] Tested by entering the donation amount value less than zero or equal to zero

Video Link: https://screencast-o-matic.com/watch/cFe26PD3zl

All 7 comments

@mathetos I agree that overall admin/form settings do not javascript validation.
For example: In multi-level donation form we must have levels.

This featured is getting a break with the multi-level form also.

See the Video for more description of the issues that I am facing

Video Link: http://screencast-o-matic.com/watch/cbXj1m2XAT

@raftaar1191 Please confirm if this issue is resolved. We should have the basic validation in place that Devin describes in https://github.com/WordImpress/Give/issues/2425#issuecomment-347689478.

  1. If form is published as _Set Donation_ and _Set Donation_ is 0 then set to 1.
  2. If form is published as _Multi-level Donation_ and _all_ levels are 0 then set to 1.

Once confirmed, close this out.

@kevinwhoffman @mathetos

Testing Summary

I have tested this issues with Give Core 2.0.7

  • [x] Tested by creating a new donation form where the Donation Option is set as Multi-level Donation

  • [x] Tested by creating a new donation form where the Donation Option is set as Set Donation and Custom Amount option is Disable

  • [x] Tested by entering the donation amount value less than zero or equal to zero

Video Link: https://screencast-o-matic.com/watch/cFe26PD3zl

Nice testing and video @raftaar1191

Was this page helpful?
0 / 5 - 0 ratings