Closed Bug 918786 Opened 12 years ago Closed 12 years ago

Contacts App allows empty email addresses

Categories

(Firefox OS Graveyard :: Gaia::Contacts, defect)

x86
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-b2g:-, b2g-v1.2 fixed, b2g-v1.3 fixed)

RESOLVED FIXED
blocking-b2g -
Tracking Status
b2g-v1.2 --- fixed
b2g-v1.3 --- fixed

People

(Reporter: jmcf, Assigned: arcturus)

Details

(Whiteboard: [u=commsapps-user c=contacts p=0])

Attachments

(2 files)

We need to check whether an email address is empty (blank spaces) and in the case not to create any entry in contact.email.
Assignee: nobody → salva
blocking-b2g: --- → koi?
Whiteboard: [u=commsapps-user c=contacts p=0]
Problem here is a little bit tricky, the email seems not being automatically trimmed as it is expected [1] when running production code. When running testing code, all works smooth so I can not reproduce the initial conditions to add a unit test. The workaround is easy (force trimming) but we need to try to figure out the root cause of the problem. I'm going to file another bug to do this. [1] http://www.w3.org/html/wg/drafts/html/master/forms.html#e-mail-state-%28type=email%29
This is the workaround until bug 920474 is solved.
Attachment #809817 - Flags: review?(jmcf)
Comment on attachment 809817 [details] Force trimming the email value the patch does not solve the problem entirely. It is needed to also check for trimmed values when enabling / disabling the done button. var emptyForm = function emptyForm() { var textFields = textFieldsCache.get(); for (var i = textFields.length - 1; i >= 0; i--) { if (textFields[i].value && textFields[i].value.trim()) return false; } return true; };
Attachment #809817 - Flags: review?(jmcf) → review-
Attached file 12470.html
Attachment #810477 - Flags: review?(francisco.jordano)
Comment on attachment 810477 [details] 12470.html Working perfectly, tests passing in local. Thanks for the work Jose
Attachment #810477 - Flags: review?(francisco.jordano) → review+
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Assignee: salva → jmcf
traige: not a release blocker but please ask for approval to land in v1.2
blocking-b2g: koi? → -
Comment on attachment 810477 [details] 12470.html NOTE: Please see https://wiki.mozilla.org/Release_Management/B2G_Landing to better understand the B2G approval process and landings. [Approval Request Comment] [Bug caused by] (feature/regressing bug #): [User impact] if declined: High [Testing completed]: [Risk to taking this patch] (and alternatives if risky): Low risk patch [String changes made]:
Attachment #810477 - Flags: approval-gaia-v1.2?(21)
Assigning to Francisco for the approval review
Assignee: jmcf → francisco.jordano
Attachment #810477 - Flags: approval-gaia-v1.2?(21) → approval-gaia-v1.2?(francisco.jordano)
No longer depends on: 920474
Comment on attachment 810477 [details] 12470.html Non risky change. a=me
Attachment #810477 - Flags: approval-gaia-v1.2?(francisco.jordano) → approval-gaia-v1.2+
Uplifted 8121cf5138f7ff9b0b60e1545f435606f4c6a6d8 to: v1.2: 8f619bea6cd56e6eade684a3eba4e6bb7a157be8
Uplifted 8121cf5138f7ff9b0b60e1545f435606f4c6a6d8 to: v1.3 already had this commit
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: