Fatal error when adding single test result without platform/opsys

RESOLVED FIXED

Status

Webtools Graveyard
Litmus
P2
critical
RESOLVED FIXED
10 years ago
a year ago

People

(Reporter: zach, Assigned: coop)

Tracking

Details

Attachments

(1 attachment)

(Reporter)

Description

10 years ago
STR - 
1. Go to a single testcase, say https://litmus.mozilla.org/show_test.cgi?searchType=by_id&id=2202
2. Choose "submit single test result"
3. Select a result, but do not choose a platform and/or operating system
4. Submit

This yields a database error, when it should be rejected by input validation. 

Thanks to benc for reporting this.
Priority: -- → P3

Comment 1

9 years ago
Ugggllllyyy.  P1
Severity: normal → critical
Priority: P3 → P1
Created attachment 365628 [details] [diff] [review]
Patch, rev 1

Making build ID, platform and OS required fields.
Assignee: nobody → fwenzel
Status: NEW → ASSIGNED
Attachment #365628 - Flags: review?(ccooper)
(Assignee)

Updated

9 years ago
Attachment #365628 - Flags: review?(ccooper) → review-
(Assignee)

Comment 3

9 years ago
Comment on attachment 365628 [details] [diff] [review]
Patch, rev 1

>+    // assume true when the field does not exist
>+    if (theField === undefined) return true;
>@@ -386,11 +388,11 @@
>+  if (theField === undefined || (theField &&

Why would we want to return true if we're being passed a non-existent field? Shouldn't the calling code be amended instead?
True, you have a point there. I will see if that's possible (if the calling code is shared between pages, it may not be possible. This is what I assumed when writing it.)
(Assignee)

Updated

9 years ago
Assignee: fwenzel → ccooper
Priority: P1 → P2
(Assignee)

Comment 5

9 years ago
We were including two JS files that both defined a function named checkFormContents(). I've renamed one of the functions, and then explicitly made sure that the fields cannot be empty.

changeset:   536:8e0bc75d9b77
changeset:   537:ce1f340e7c64
Status: ASSIGNED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
Product: Webtools → Webtools Graveyard
You need to log in before you can comment on or make changes to this bug.