Bug 1174071

Summary: [SPA editor] Save on Invalid entry should not cause NullPointerException
Product: [Retired] Zanata Reporter: Patrick Huang <pahuang>
Component: Component-Logic, Component-UIAssignee: Patrick Huang <pahuang>
Status: CLOSED CURRENTRELEASE QA Contact: Ding-Yi Chen <dchen>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.4CC: dchen, zanata-bugs
Target Milestone: ---   
Target Release: 3.6   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 3.6.0-SNAPSHOT (git-jenkins-zanata-server-github-pull-requests-2476) Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-19 07:10:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1150373    

Description Patrick Huang 2014-12-15 04:24:05 UTC
Description of problem:
When saving untranslated entry in new editor, the revision field is null and will be rejected by server with 400 bad request. If project enables validation enforcement, if a message failed validation, the result comes back as 500 internal server error because server failed to store validation result in the list.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Find a project with validation e.g. enforce html/xml tag
2. Find a message that potentially can break validation and is untranslated
3. Open in new editor and fill in an invalid translation (e.g. missing a tag)

Actual results:
Can't save (need to view the result in browser console. New editor don't have a notification system other than console log)

Expected results:
Save

Additional info:

Comment 1 Patrick Huang 2014-12-15 04:42:56 UTC
https://github.com/zanata/zanata-server/pull/648

Comment 2 Patrick Huang 2015-01-08 03:22:12 UTC
Expected result should be:
Can't save invalid translation but won't cause a server NullPointerException. Client browser console log shows server returns 500.

Comment 3 Ding-Yi Chen 2015-01-13 00:31:45 UTC
The "real" expected behavior is ask the user to either save as "Need Work" or back to edit.

However, the scope of this bug is to remove the cause of NullPointerException.

VERIFIED with Zanata 3.6.0-SNAPSHOT (git-jenkins-zanata-server-github-pull-requests-2476)