Page MenuHomePhabricator

Bug: donations below should include error message on updonate
Open, Needs TriagePublic

Description

We need a message when a donor enters an amount below the minimum. Currently it's just a red box with no information.

Event Timeline

mepps created this task.Wed, Aug 14, 5:26 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptWed, Aug 14, 5:26 PM
mepps added a comment.Wed, Aug 14, 7:42 PM

So I had a weird experience testing this locally. I saw the error on my first test. Then I added some logging and tested again, and strangely the error text showed up! Then I tried to test without the logging (though it seemed weird if that fixed it) and there was an unrelated bug on ingenico's side that prevented me from testing further.

mepps claimed this task.Wed, Aug 14, 7:42 PM
mepps moved this task from Triage to Current Sprint on the Fundraising-Backlog board.
mepps moved this task from Backlog to Doing on the Fundraising Sprint Princess Mongodb board.
mepps added a comment.Thu, Aug 15, 1:15 PM

Okay, so I've found more interesting behavior. Basically the error highlighting appears if I tab away from the box, but when I click "Donate Monthly" the error text appears. I've been trying to find where in the code the highlight is applied but haven't found it yet.

mepps added a comment.Thu, Aug 15, 1:17 PM

There are two places I thought the initial error highlighting might be coming from: validation_input and ext.donationinterface.validation.js, but when I enter console.log statements in them, they are not logged.

mepps added a comment.Thu, Aug 15, 2:33 PM

I'm currently thinking this might be something from Firefox, because I noticed the red highlighting doesn't happen in Chrome and the errorHighlight class doesn't seem to have actually been applied. I'm trying to test one more idea.

Change 530380 had a related patch set uploaded (by Mepps; owner: Mepps):
[mediawiki/extensions/DonationInterface@master] Changed class and id names to fit conventions from other forms Could improve tech debt slightly later, but open to not merging this

https://gerrit.wikimedia.org/r/530380

mepps added a subscriber: CCogdill_WMF.

@CCogdill_WMF Can you confirm whether you see the error message when you directly click on the "Donate Monthly" button versus just tabbing away? That's what I found in my testing but want to confirm it. Thanks!

mepps added a subscriber: Ejegg.Thu, Aug 15, 9:09 PM

@Ejegg Oh! I think this is caused by the type being "number" as I've learned it happens when any value with a decimal place is entered.

Ejegg added a comment.Thu, Aug 15, 9:11 PM

@mepps I guess that type=number was set to pop up the numeric keypad on mobile devices. See T217854 for other ways to do this, which would allow decimals.

mepps added a comment.Thu, Aug 15, 9:16 PM

Yup @Ejegg I got it. I'll put up a patch tomorrow morning.

Change 530582 had a related patch set uploaded (by Mepps; owner: Mepps):
[mediawiki/extensions/DonationInterface@master] Add step and min to avoid html validation error

https://gerrit.wikimedia.org/r/530582