Page MenuHomePhabricator

Regression: Form validation fails on submit regardless of validity
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:

  • Validation errors are shown for every field
  • The form does not submit

What should have happened instead?:

  • No validation errors are shown
  • The form submits successfully

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

image.png (131×508 px, 18 KB)

Details

Related Changes in GitLab:
TitleReferenceAuthorSource BranchDest Branch
WishlistIntake: fix more issues follow botched merge commitrepos/commtech/wishlist-intake!160musikanimalfix-prodmain
db: rename problem field to descriptionrepos/commtech/wishlist-intake!159musikanimalrename-problem-to-descriptionmain
Use Wish propsrepos/commtech/wishlist-intake!157samtarT369494main
Customize query in GitLab

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
TheresNoTime renamed this task from Regression: Form validation fails on submit regardless of validity to Regression: Form validation fails on submit regardless of validity.Jul 8 2024, 10:21 AM

this.validateForm() is firing before some/all promises are completed? this.wishtitle.length (and others) in validateForm are returning 0 when called in

handleSubmit() {
	this.formDisabled = true;
	Promise.all( preSubmitPromises ).then( () => {
		// @todo Handle this nicer?
		if ( !this.validateForm() ) {
			this.formDisabled = false;
			return;
		}

That'll be because it's this.wish.title (:

I've attached two more MRs to this task. The task description is accurate as to the initial issue, but the actual problem was a botched merge commit that was part of !104. The other two MRs I believe fix the remaining issues.

QA here is basically "make sure nothing broke", so instead I'm going to call this resolved and point QA to T367917 which is the work that caused these regressions. All issues mentioned in this task have been fixed, which essentially puts us to where T367917 was supposed to be originally.

Also noting for the record we have a decently well-rounded Selenium test now, so assuming developers remember to run it (because it doesn't run in CI, yet), regressions like this should never happen again :)