Page MenuHomePhabricator

Bug: donations below should include error message on updonate
Closed, ResolvedPublic

Description

Screen Shot 2019-08-14 at 6.48.26 PM.png (1×1 px, 203 KB)

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

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.

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.

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.

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!

@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.

@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.

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

Change 530582 abandoned by Mepps:
Add step and min to avoid html validation error

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

Change 530380 merged by jenkins-bot:
[mediawiki/extensions/DonationInterface@master] Used ids instead of classes and allowed for comma and decimal inputs

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

Looks like "Used ids instead of classes and allowed for comma and decimal inputs" is still waiting to go out. Last deploy was these:

2fb8a4049 Non-USD support for updonate
d7d56b60b Fix other amount validation for updonate
44180d5d4 Card alt text: include when translated

OK, this is indeed deployed.